Instead of checking the session, do this:
<h1>
<? if ($this->Session->check('Auth.User')) {
echo 'Logout';
} else {
echo 'Login';
}?>
</h1>
Jeremy Burns
Class Outfit
Tel: +44 (0) 208 123 3822
Mob: +44 (0) 7973 481949
Skype: jeremy_burns
http://www.classoutfit.com
Jeremy Burns
Class Outfit
http://www.classoutfit.com
On 7 Nov 2011, at 14:48, Ogalav wrote:
> Hi,
>
> i want show in the default.ctp in the header one content that will
> have link for logut or login, depending on the recording session
> active.
> so, i´m doing this:
>
> views/layouts/default.ctp
> <div id="header">
>
> <h1>
> <? if (isset($this->Session->read('Auth.User'))){
> echo 'Logout';
> }
> else {
> echo 'Login';
> }?>
> </h1>
> </div>
> ------------------------------------------
> and the users
>
> public function login() {
>
> if ($this->Auth->login()) {
>
> $this->redirect($this->Auth->redirect(array('controller' =>
> 'ordens', 'action' => 'orden')));
>
> }
> }
>
>
> but, can´t show it. it´s given to me the Fatal error: Can't use
> method return value in write context
>
> thanks for you help
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> [email protected] For more options, visit this group at
> http://groups.google.com/group/cake-php
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php