I am struggling with disabling view in ZF2 $this->_helper->viewRenderer->setNoRender(); or (true)
with no luck as it always says there
You can do so using the console model, or kill execution arbitrarily.
'Hello World',
));
}
// Json Method
public function jsonAction() {
return new JsonModel(array(
'message' => 'Hello World',
));
}
// This is really exaggerated, but it is quite effective.
public function killAction() {
echo 'Hello World';
exit;
}
}
In view use: some.phtml
json.phtml