public function getLastLogin(){
return $this->_lastLogin;
}
Now in view index.php i have
<?php if(!Yii::app()->user->isGuest):?>
<p>
You last logged in on <?php echo date( 'l, F d, Y, g:i a', Yii::app()->user->lastLoginTime ); ?>.
</p>
<?php endif;?>
How to include in the if the checking of something in the variable of the method?
Your question is not clear to me. I think you are changing the Yii testdrive code. In that sample code, you don’t use database or any other storage to store username/password, but an array containing them. In that sample, you cannot save save the last login time, unless you store it in a cookie, or something like that.