Yii Framework Forum: Display The Login Form In The Main Layout - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Display The Login Form In The Main Layout Rate Topic: -----

#1 User is offline   abderrahmane 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 9
  • Joined: 25-January 13

Posted 25 January 2013 - 05:41 PM

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 :)
0

#2 User is offline   PeRoChAk 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 579
  • Joined: 26-November 10
  • Location:Lahore, Pakistan

Posted 25 January 2013 - 10:30 PM

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

<div id="header">
<a href="#">Index</a>
<?php
$this->renderPartial('//layouts/userpanel');
 ?>
</div>

Cheers
Perochak
Web Design - Logo Design - Application Development

My Blog | Forums Comparison
0

#3 User is offline   Liam Carter 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 18
  • Joined: 30-August 12

Posted 28 January 2013 - 03:25 PM

Also use

if(Yii::app()->user->isGuest)


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

Regards

Liam
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users