【发布时间】:2014-12-15 08:13:17
【问题描述】:
我有一个带有访问器的用户实体
namespace App\Model\Entity;
use Cake\ORM\Entity;
use Cake\Auth\DefaultPasswordHasher;
class User extends Entity {
protected $_accessible = [
'email' => true,
'username' => true,
'password' => true,
];
protected function _getFullname() {
return $this->_properties['firstname'] . ' ' .$this->_properties['lastname'];
}
}
当我打印时
$user->fullname
在看来它工作正常 但是我怎样才能在结果中获得全名
pr($this->Auth->user());
【问题讨论】:
标签: cakephp authentication field virtual cakephp-3.0