diegovarussa
5/19/2013 - 6:19 PM

Atualizar o layout do XML via programação.

Atualizar o layout do XML via programação.

<?php
    
    $update = $this->getLayout()->getUpdate();
    $this->addActionLayoutHandles();
    $this->loadLayoutUpdates();
    /* 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>
    ');
    $this->generateLayoutXml()->generateLayoutBlocks();
    $this->renderLayout();