I\'m writing a basic plugin for my cakePHP 2.x app following the instructions in the book.
I\'ve created the directory/file structure with a MyPluginAppController.ph
I was't using a plugin so my case was a bit different. However, this question shows up on the search results page, so I'll post this here.
This is the problematic controller.
<?php
class ArticlesController extends AppController {
public function beforeFilter() {
}
public function view() {
// do stuff
}
}
CakePHP kept showing me the following error:
Missing View
Error: The view for ArticlesController::view() was not found.
Confirm you have created the file: Articles/view.ctp in one of the following paths:
I checked all paths it suggested using is_readable() and the stat command to make sure the view file exists and is indeed readable by PHP.
The issue there is the empty beforeFilter()
. As soon as I removed it everything worked.
Rename this file
app/Plugin/MyPlugin/View/MyModel/admin_index.php
To this extension .ctp
app/Plugin/MyPlugin/View/MyModel/admin_index.ctp
This is a common mistake.