我正在本地開發CakePHP站點。我創建了UsersController使用的用戶模型。一切工作正常我的箱子,但只要我檢查我的主機上的代碼(WebFaction)CakePHP開始試圖執行用戶模型中的方法的名稱作爲SQL查詢。CakePHP作爲SQL查詢執行方法名稱
# users_controller.php
public function index() {
$this->User->dummy_function();
$users = $this->User->find('all');
$this->set(compact('users'));
}
# User.php
public function dummy_function() { }
現在,當我瀏覽到用戶/指數我得到以下錯誤:
Warning (512): SQL Error: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dummy_function' at line 1 [CORE/cake/libs/model/datasources/dbo_source.php, line 684]
和CakePHP的執行是dummy_function
由此可見,框架不能找到我的用戶模型和查詢我的主機與此有關,但我已經在此服務器上部署了CakePHP應用程序,並且從未遇到此問題。我正在使用CakePHP 1.3.11。有任何想法嗎?
任何想法可以解決這個問題2.3在公約是新的? –