How do I
var_dump data in the file controller and Model?
and view source ... but it's not displayed
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.Sign up to join this community
I rarely use var_dump or echo to the screen when programming Magento. I find it far better to use print_r in conjunction with the Magento logging function.
Add a line like this to your code -
Mage::log("this is my data -\n".print_r($model->debug(),true),1,"mylogfile.log",true);
This will dump the debug data for the model to a log file called mylogfile.log in the var/log directory under Magento's root. The final true parameter to the log function forced the logger to write regardless of Magento's logging setting.