2015-10-06 29 views
-1

我在UsersController錯誤中缺少方法。如何使用CakePHP 3解決UserController中的缺失方法?

The action table_datatable.ctp is not defined in UsersController.

Error: Create UsersController::table_datatable.ctp() in file: src\Controller\UsersController.php.

<?php 
namespace App\Controller; 

use App\Controller\AppController; 

class UsersController extends AppController 
{ 

    public function table_datatable.ctp() 
    { 

    } 
} 

回答

4

的錯誤消息取決於所請求的URL,該錯誤消息意味着你請求這個網址:

http://example.com/users/table_datatable.ctp 

.ctp從未在網址 - 網址不匹配模板文件的路徑;只有the webroot folder被設計爲可以直接網絡訪問。

繼續之前,做the blog tutorial是一個好主意,它只需要大約15分鐘,並且會給你一個關於CakePHP如何工作以及如何使用它的基本介紹。

相關問題