我已经创建了一个插件,其中包含了一个组件。因此在插件组件中,我必须包含会话组件,以调用它们方法write和read。如何调用这些方法?
发布于 2012-06-17 16:14:38
插件仍然使用底层的Cake core,因此在插件的AppController()中,您应该能够在$components变量中加载SessionComponent。以下是$components设置的示例:
public $components = array(
'DebugKit.Toolbar',
'Session',
'Auth' => array(
'loginRedirect' => array('controller' => 'users', 'action' => 'index'),
'logoutRedirect' => array('controller' => 'users', 'action' => 'login')
),
'RequestHandler'
);你试过这个吗?
https://stackoverflow.com/questions/11030823
复制相似问题