2017-01-25 7 views

答えて

1

<?php echo $this->getLayout()->createBlock('responsivebannerslider/index')->setTemplate('responsivebannerslider/index.phtml')->toHtml(); ?>

+0

、それは働いていました... –

2

あなたは直接PHTMLテンプレートファイルでレイアウト上のブロックを作成して、テンプレートからそれを呼び出すことができます。

<?php echo $this->getLayout()->createBlock('responsivebannerslider/index')->setTemplate('responsivebannerslider/index.phtml')->toHtml(); ?> 

またはブロックが機能拡張に記載されている場合レイアウトXMLファイル(参照ノード内にネストされる)は次のようになります。

<block type="responsivebannerslider/index" name="responsivebannerslider_index" as="an_alias" template="responsivebannerslider/index.phtml"> 
    <label>Responsive banner</label> 
</block> 

そして、あなたはあなたのようなテンプレートファイルにそれを呼びたい:ありがとうアクタール

<?php echo $this->getChildHtml('an_alias'); ?> 
関連する問題