Skip to content
April 6, 2007 / edivad

CakePHP: controller without model

Having a controller without a model in CakePHP is very simple: just declare the variable $uses=null in the controller.

class MycoolsController extends AppController{
var $name="Mycools";
var $uses = null;
...
}

3 Comments

Leave a Comment
  1. atan / Jan 4 2010 12:17 pm

    Well, I tried this one. But what if, i want to use external models and i _have_ to use $uses? Such as $uses = array(‘Html’, ‘Javascript’); ?

    • edivad / Jan 5 2010 1:27 pm

      atan, you want to use a Controller, with one or more external Model, you won’t care about “no models” :) Simply use the $uses.

Trackbacks

  1. links for 2009-12-22 « Breyten’s Dev Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.