Pure Software Knowledge Base Glossary    Contact Us
 
   
Browse by Category
Pure Software Knowledge Base > Lore > Troubleshooting > Smarty/Template Problems > Why do I get Smarty template errors where I have PHP code?

Why do I get Smarty template errors where I have PHP code?

In order to use PHP code within the Smarty templates, you either have to wrap the code in {php} {/php} tags, or use {include_php} if you are including a separate PHP file. Examples:

Inserting PHP code into a template:

{php}
// PHP code goes here
{/php}

Including a PHP file into a template:

{include_php file="my_php_file.php"}


How helpful was this article to you?

Related Articles

Why do I get Smarty template errors where I have JavaScript/CSS code?
Smarty recognizes several types of tags, some of which can be within...

 
Do you provide code customization services?
No, we do not provide code customization services at this time, whether...

 
Why don't my template changes show up?
Smarty compiles the templates into PHP code and caches them. When you...

 

User Comments

No comments have been posted.


powered by Lore