based on your code below I would try :
<?php if($this->Session->check('user')) : ?>
SIGNIN CONTENT
<?php else: ?>
NOT SIGNIN CONTENT
<?php endif ?>
Andras Kende
On Sep 24, 2012, at 1:37 AM, Chris <chris69m@yahoo.com> wrote:
thanks Andras,... it works,... but I'm running into some other problems,.... with UserHelper.php etc,...the problem is I need to display signin content and not signin content for user. and I have this working on old version of CAKE,... probably the very first version,... PREBETA version ;)what I have on view file is:<?php if($user->is_user()): ?>SIGNIN CONTENT<?php else: ?>NOT SIGNIN CONTENT<?php endif ?>but I'm getting an error:Undefined variable: user [APP/View/Home/index.ctp, line 2]I think this has something to do with UserHelper.php ,... isn't it?class UserHelper extends Helper { var $user = null; function UserHelper() { $this->user = $this->read('user'); } function is_user() { return isset($this->user); }.....I appreciate your help,... in advancemucho thanks
On Sunday, September 23, 2012 3:24:50 PM UTC-7, Andras Kende wrote:try to add 'Session' to your components…public $components = array('Session', 'Cookie', 'RequestHandler');Andras KendeOn Sep 23, 2012, at 2:55 PM, Chris <chri...@yahoo.com> wrote:hi guys,...having a problem to migrate to a new version 2.2.2in AppController I have:App::uses('Controller', 'Controller', 'CakeEmail', 'Network/Email');class AppController extends Controller {static $FLASH_ALLOWED_TYPES = array('error', 'valid', 'notice');var $helpers = array('Javascript', 'Ajax', 'User', 'Session', 'App');var $components = array('Cookie', 'RequestHandler');function beforeFilter(){if($this->Session->check('user')) $this->user = $this->Session->read('user');and it gives me an errorFatal error: Call to a member function check() on a non-object in /home/xachkaa/hamayk.com/html/app/Controller/ on line 139AppController.php can anybody tells me what's wrong with it please ...thanks--
Like Us on FacekBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake...@googlegroups.com.
To unsubscribe from this group, send email to cake-php+u...@googlegroups.com .
Visit this group at http://groups.google.com/group/cake-php?hl=en .
--
Like Us on FacekBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
No comments:
Post a Comment