Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save VIVEKLUCKY249/968dc867ce3237cc731c9074d1f97800 to your computer and use it in GitHub Desktop.
Save VIVEKLUCKY249/968dc867ce3237cc731c9074d1f97800 to your computer and use it in GitHub Desktop.
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