我有一个链接,比如http://www.myweb.it/people/add/
执行时我有关于不存在的add
视图和 json 的问题:
错误:未找到 PeopleController::add() 的视图。
错误:确认您已创建文件:/var/datas/httpd/vhosts/myweb.it/demo/htdocs/0.4/app/View/elements/json.ctp
问题是在本地正确处理了导入的文件。这是整个人员控制器:
<?php
class PeopleController extends AppController {
var $name = 'People';
public $components = array('RequestHandler');
public $helpers = array('Html', 'Form');
public function add() {
$this->autorender = false;
if ($this->request->is('post')) {
if ($this->Person->save($this->request->data)) {
$this->set('return', 'I dati sono stati salvati.');
} else {
$this->set('return', 'Non è stato possibile salvare i dati.');
}
}
$this->layout = 'void';
$this->render('/elements/json');
}
public function getPeopleByName(){
$people = $this->Person->getPeopleByName($_GET['name']);
$this->set(array(
'People' => $people,
'_serialize' => array('People')
));
}
}
任何的想法?