缺少方法公共函数索引()

时间:2014-01-08 06:00:11

标签: cakephp-2.0

  

BusinessController中缺少方法   错误:操作索引未在控制器BusinessController中定义   错误:在文件中创建BusinessController :: index():app / Controller / BusinessController.php。   

如果我添加此方法,它会将我带到主页。我想去business_index.ctp

这是我的控制器

  

App :: uses('Controller','Controller');   class BusinessController扩展AppController {      public $ name ='商业';      public $ components = array('Auth','RequestHandler','Cache');      public $ uses = array('User','CreditHistory');      public function beforeFilter(){          父:: beforeFilter();      }

     

function Sync(){          $ this-> layout = $ this-> autoRender = false;      }      //管理员仪表板      public function business_index(){          $这 - >设置( '标题', '仪表板');          $ uid = $ this-> Auth-> User('id');          $这 - >设置( 'USER_ID',$ UID);      }

我在文件夹名称Business

中有一个名称business_index.ctp

不确定我做错了什么。

1 个答案:

答案 0 :(得分:0)

您可以重定向$ this-> redirect('business_index');在索引方法中或在config / routes.php中添加路由器规则。见http://book.cakephp.org/2.0/en/development/routing.html

相关问题