Reputation: 962
i installed fresh cakephp. its app controller working fine. but when i write my controller and its view but this result in page not found. My code is given below
class PostsController extends Controller {
public $helpers = array('Html', 'Form');
public function index() {
$this->set('posts', $this->Post->find('all'));
}
}
and create folder named Posts in view folder and over there create index.ctp file as well. but its result in page not found. Please help what may be mistake by me or is there any need to configuration. Thanks
Upvotes: 0
Views: 1679
Reputation: 4526
there might problem apache rewrite module. if you are using WAMP, just put on your rewrite module.
Upvotes: 0
Reputation: 715
Your controller should be named PostsController.php (ie plural)
Just spotted it, you need to extend AppController
in CakePHP 2.x, not Controller
: ie:
class PostsController extends AppController {
Upvotes: 3