Reputation: 28892
How do I create a controller with no view and model?
Making a services_controller to spit out json.
This is what I have now.
var $uses = array();
function test() {
$this->autoRender = false;
echo "test";
}
However, that doesn't print out the "test" message.
Thanks,
Tee
Upvotes: 13
Views: 11884
Reputation: 93
$this->autoRender = false;
This one works like a die() function. Put it at the end of the function.
Upvotes: 0
Reputation: 391
Just write $this->autoRender = false; at the end of the function. It will surely work.
Upvotes: 3
Reputation: 11
I know that using the statement below your controller is without reference to any model:
public $ uses = null;
Upvotes: 0
Reputation: 28892
The above code actually works. The issue was somewhere else related to the Auth component.
Thanks,
Tee
Upvotes: 4