我試圖將SessionComponent添加到我的控制器以便能夠在運行中更改我的應用程序的語言。下面的代碼片段(特別是3號線)是我根據http://book.cakephp.org/2.0/en/controllers/components.html#using-components嘗試將組件添加到CakePHP中的AppController時出現錯誤
class AppSettingsController extends AppController
{
var $components = array('Session');
試圖代碼但當我嘗試運行我的任何控制器的行動,我得到:
SessionComponent could not be found.
Create the class SessionComponent below in file:
src/Controller/Component/SessionComponent.php
彷彿SessionComponent不存在。我已經能夠找到所有的答案,說我已經完成了應該工作。你有什麼想法我可能錯過了什麼,或者我應該考慮修復它?
您有哪些CakePHP的版本?在CakePHP v2.7中。 FlashComponent是爲SessionComponent添加的 – Provie9