Best way to output ajax data from a Magento Admin Extension

I'm writing a Magento Admin extension that has some ajax callbacks in it. Up until now I've been echoing the json I'm feeding back through the ajax call with a simple echo statement in the controller. It "works" but I get a bunch of errors like this in my log file:

2010-12-14T15:37:05+00:00 DEBUG (7): HEADERS ALREADY SENT:

[0] /home/simplifiedsafety/www/store/app/code/core/Mage/Core/Controller/Response/Http.php:44
[1] /home/simplifiedsafety/www/store/lib/Zend/Controller/Response/Abstract.php:727
[2] /home/simplifiedsafety/www/store/app/code/core/Mage/Core/Controller/Response/Http.php:75
[3] /home/simplifiedsafety/www/store/app/code/core/Mage/Core/Controller/Varien/Front.php:188
[4] /home/simplifiedsafety/www/store/app/code/core/Mage/Core/Model/App.php:304
[5] /home/simplifiedsafety/www/store/app/Mage.php:599
[6] /home/simplifiedsafety/www/store/index.php:104

Думаю, чтобы этого избежать, мне нужно протолкнуть это через какой-то блок. Может кто-нибудь дать мне небольшое руководство по этому поводу?

5
задан Drew Hunter 18 June 2012 в 20:31
поделиться