I am reading the No frills magento layout book written by Alan Storm. I have come across the following code:
public function handleAction()
{
$this ->loadLayout();
$handles = Mage::getSingleton('core/layout')->getUpdate()->getHandles();
var_dump($handles);
exit;
}
What is the need of that exit in this code ? That code works perfectly without that exit.
It stops the rest of the code from executing, looking at that script it seems like the purpose of it is to debug something. Having the rest of your page render won't make that debugging any easier since CSS styles will be applied that could make the var_dump()
less readable.
Also there could be a redirect involved or such which could cause your var_dump()
to disappear immediately, using exit
you prevent the redirect from happening.
Bottom line, it's just not needed to have the rest of the code render.