this is a sample page from files of my app
namespace cake \ Controller;
使用cake \ Controller \ AppController;
这两行在Dreamweaver中显示为红色
答案 0 :(得分:1)
在cakephp中,所有控制器都在命名空间App\Controller
中并使用App\Controller\AppController
,因为AppController
是默认值,所有其他控制器都扩展它。
namespace App\Controller;
use App\Controller\AppController;
/**
* Users Controller
*
* @property \App\Model\Table\UsersTable $Users
*/
class UsersController extends AppController
{
/**
* Index method
*
* @return \Cake\Network\Response|null
*/
public function index()
{
$users = $this->paginate($this->Users);
$this->set(compact('users'));
$this->set('_serialize', ['users']);
}
}