$user = $this->Session->read('Auth'); 生成以下数组:
array(
'User' => array(
'id' => '2',
'email' => 'info@trinoweb.com',
'username' => 'trino',
'created' => '2012-10-11 12:41:52',
'modified' => '2012-10-11 12:41:52',
'last_online' => null,
'main_image' => null,
'address' => null
)
)我希望它能产生相同的东西,但是有所有的连接/关系...像这样..。
array(
'User' => array(
'password' => '*****',
'id' => '128',
'email' => '12312@asdas.com',
'username' => 'teresa',
'created' => '2012-10-11 12:41:52',
'modified' => '2012-10-11 12:41:52',
'last_online' => null,
'main_image' => null,
'address' => null
),
'Inbox' => array(),
'Sender' => array(),
'Upload' => array()
)提前谢谢。
发布于 2012-10-12 09:46:55
不,除非您在填充Auth密钥时将其写入其中。这是一个会话变量,而不是模型上的动态查找。
您基本上需要修改登录方法来查找这些关系,然后填充会话数据。
请记住,这将是静态数据。如果您更改了关系,则不会在此数组中反映出来。当发生这种情况时,您将需要更新此数组,然后它将变得混乱。
https://stackoverflow.com/questions/12850910
复制相似问题