Display The Login Form In The Main Layout

Hey guys,

I’m wondering how to add the login form in the header of my layout in every page that the user isn’t authenticated.

Thanks in advance :)

You can use widget or portlet or general code(render partial) for this purpose

<div id="header">

<a href="#">Index</a>





Also use


to determine if user is loged in, if you have used the Yii CUserIdentity.