Posted By

nico65 on 04/29/11


Tagged


Versions (?)

easy way to call php in static blocks or CMS


 / Published in: PHP
 

Call the snippet above in youre Code via:

{{block type="core/template" name="test-snippet" template="catalog/snippets/test-snippet.phtml"}}

  1. // make file:
  2. /app/design/frontend/YOUR-THEME/YOUR-TEMPLATE/template/catalog/snippets/test-snippet.phtml
  3.  
  4. <?php echo test ?>
  5.  
  6. // call the above file in another phtml:
  7.  
  8. <?php echo $this->getLayout()->createBlock('catalog/snippets_test-snippet')->setTemplate('catalog/snippets/test-snippet.phtml')->toHtml(); ?>

Report this snippet  

You need to login to post a comment.