Controller without Model in CakePHP

In some cases you may need to have a controller without its own model. This might be because you are using other models. You can do this by using an empty array.

<?php
class HomesController extends AppController {
	var $name = 'Homes';
	var $uses = array(); // Don't use Home Model
	function index() {

	}
}
?>

Related Post

Import a Controller in CakePHP
Model without Table in CakePHP
In the V-Model of Testing when System Tests are prepared?
nested exception is java.lang.IllegalStateException: Cannot create command without commandClass

Comments

Leave a Reply