Skip to main content
added 1 character in body
Source Link
Kumar M
  • 787
  • 1
  • 4
  • 6

If you have already a template the do call it like:

echo $this->getLayout()->createBlock('core/template')->setFormAction($this->getUrl('contacts/index/post', array('_secure'=>true)))->setTemplate('contacts/form.phtml')->toHtml();

Because your 2nd way it like adding additional step to call same result. While 1st way does have wrong block because you don't need that, you just need to call block core/template and just set FormAction to it.

If you have already a template the do call it like:

echo $this->getLayout()->createBlock('core/template')->setFormAction($this->getUrl('contacts/index/post', array('_secure'=>true))->setTemplate('contacts/form.phtml')->toHtml();

Because your 2nd way it like adding additional step to call same result. While 1st way does have wrong block because you don't need that, you just need to call block core/template and just set FormAction to it.

If you have already a template the do call it like:

echo $this->getLayout()->createBlock('core/template')->setFormAction($this->getUrl('contacts/index/post', array('_secure'=>true)))->setTemplate('contacts/form.phtml')->toHtml();

Because your 2nd way it like adding additional step to call same result. While 1st way does have wrong block because you don't need that, you just need to call block core/template and just set FormAction to it.

Source Link
Kumar M
  • 787
  • 1
  • 4
  • 6

If you have already a template the do call it like:

echo $this->getLayout()->createBlock('core/template')->setFormAction($this->getUrl('contacts/index/post', array('_secure'=>true))->setTemplate('contacts/form.phtml')->toHtml();

Because your 2nd way it like adding additional step to call same result. While 1st way does have wrong block because you don't need that, you just need to call block core/template and just set FormAction to it.