I've made an API controller with some actions to spit out JSON for my app and I've turned off the layout and view renderer in its init()
method so I've got no view scripts for this controller.
I'm trying to use my apiController::treeAction
elsewhere in the app via an actionHelper
to output some JSON inline. I can access the action directly via /api/tree/id/1
which shows me the JSON data. But when I try and fetch from another controller with
$this->view->action('tree', 'api', null, array('id'=>$id))
I get an exception
Message: script 'api/tree.phtml' not found in path ([...]\application\views\scripts\)
It's right, that file doesn't exist, but I don't need it to. What am I doing wrong?