easy way to call php in static blocks or CMS


/ Published in: PHP
Save to your folder(s)

Call the snippet above in youre Code via:

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


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.