【发布时间】:2013-02-05 07:22:19
【问题描述】:
您好,我的代码在 CakePHP 框架中无法运行,并且显示错误消息。
网址:
http://domainname.com/About/param1/param2
代码:
class AboutController extends AppController {
public $name = 'About';
public $helpers = array('Html');
public function index($arg1, $arg2)
{
print_r($this->request->params['pass']);
$this->set('title_for_layout','Sarasavi Bookshop - About Sarasavi Bookshop');
$this->set('nameforfiles','about');
}
}
错误信息:
Missing Method in AboutController
Error: The action param1 is not defined in controller AboutController
Error: Create AboutController::param1() in file: app\Controller\AboutController.php.
<?php
class AboutController extends AppController {
public function param1() {
}
}
Notice: If you want to customize this error message, create app\View\Errors\missing_action.ctp
创建函数param1后,我可以得到param2,但是我需要同时得到param1和param2,在index函数中没有创建另一个动作。
请帮帮我, 谢谢
【问题讨论】:
标签: php cakephp routing url-routing