I would create two elements, menu.ctp and login_form.ctp, and load
either based on whether the person is logged in.

if ($this->Session->read('Auth.User'))
{
    echo $this->element('menu');
}
else
{
    echo $this->element('Users/login_form');
}

On Wed, Jul 4, 2012 at 3:01 PM, Chris <[email protected]> wrote:
> I am the beginer in cakePhp. I have a problem. My website has one div, and
> inside of it it has to show menu or login form (depends on user login).
> Where can I do it? It is repeated in all pages. I think, that I should
> create this in layout, to not repeat it in every view, but really havo no
> idea how.'
>
> Thank's for your answers!
>
> --
> 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

Reply via email to