I'm working on a system (ActiveCollab) that uses Smarty for templates. I want to output some JSON so I need to have it output by itself... no other cruft. However, if I do NOT provide a Smarty template file for the corresponding action I get an error output that ruins the JSON.
Does anyone know how to disable Smarty output on a case by case basis? In pseudocode, something like
$this->smarty->disable();
Failing that, does anyone know how to have ActiveCollab not require a template file for output? Or even know of a better way to output JSON for consumption within ActiveCollab?
My main goal is to output json for use by jqgrid within ActiveCollab, in case that helps.
Thanks.
EDIT:
It turns out it's as simple as adding die();
after the desired output.
function bar(){
echo $myoutput;
die();
}
That's it. Why I always look for the "hard" answer when the solution is so basic I will never know... sigh.