Tuesday, January 06, 2009

CakePHP: controller without models

How to create a controller without models. When you don't specify anything in a controller: Error: Database table tableName for model modelName was not found. So, you can do this:
class PagesController extends AppController {
  var $name = 'Pages';
  var $uses = array();#this controller uses no models...
}
And now you can edit your views and that's it...

No comments: