0
votes

Missing Method in BusinessController Error: The action index is not defined in controller BusinessController Error: Create BusinessController::index() in file: app/Controller/BusinessController.php.

If I add this method, it brings me to the homepage. I want to go business_index.ctp

Here is my controller

App::uses('Controller', 'Controller'); class BusinessController extends AppController { public $name = 'Business'; public $components = array('Auth','RequestHandler','Cache'); public $uses = array('User','CreditHistory'); public function beforeFilter(){ parent::beforeFilter(); }

function Sync(){ $this->layout = $this->autoRender = false; } //Admin Dashboard public function business_index(){ $this->set('title','Dashboard'); $uid = $this->Auth->User('id'); $this->set('user_id',$uid); }

I have a view name business_index.ctp inside a folder name Business

Not sure what I am doing wrong.

1

1 Answers

0
votes

You could either do redirect $ this-> redirect ('business_index'); in your index method or add router rule in config/routes.php. See http://book.cakephp.org/2.0/en/development/routing.html