ver: cake 2.4.2

・変数のセット
Controller/AppController.php

    public function beforeFilter() {
        // add for login check
        $this->set( 'loggedIn', $this->Auth->loggedIn() );
    }

例:ヘッダーで判定

	if ($loggedIn)
	{
	echo '

'. $this->Html->link(__('Logout'), array('controller' => 'users', 'action' => 'logout')) . "

"; } else { echo '

'. $this->Html->link(__('Login'), array('controller' => 'users', 'action' => 'login')) . "

" }

Leave a Reply

Your email address will not be published. Required fields are marked *