Forked from vkathirvel/Magento Layout in Controller
Created
January 28, 2017 06:44
-
-
Save VIVEKLUCKY249/968dc867ce3237cc731c9074d1f97800 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function mycoolAction() | |
{ | |
/* ... Some code ...*/ | |
$update = $this->getLayout()->getUpdate(); | |
/* ... Some code ...*/ | |
$this->addActionLayoutHandles(); | |
/* ... Some code ...*/ | |
$this->loadLayoutUpdates(); | |
/* ... Some code ...*/ | |
/* My stuff, add pure XML like you do from XML layout files <img src="http://inchoo.net/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley"> */ | |
$update->addUpdate(' | |
<reference name="head"> | |
<action method="addJs"><script>varien/product.js</script></action> | |
<action method="addItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name><params /><!--<if/><condition>can_load_calendar_js</condition>--></action> | |
<action method="addItem"><type>js</type><name>calendar/calendar.js</name><!--<params/><if /><condition>can_load_calendar_js</condition>--></action> | |
<action method="addItem"><type>js</type><name>calendar/calendar-setup.js</name><!--<params/><if /><condition>can_load_calendar_js</condition>--></action> | |
<action method="addItem"><type>skin_js</type><name>js/bundle.js</name></action> | |
</reference> | |
'); | |
/* ... Some code ...*/ | |
$this->generateLayoutXml()->generateLayoutBlocks(); | |
/* ... Some code ...*/ | |
$this->renderLayout(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment