PDA

View Full Version : PHP in Smarty?



tj
08-16-06, 11:22 PM
Ok im trying to skin the new system but for some reason I cant get the php includes to work properly?

According to the smarty manual if you want to include php in your template just add the {include_php} in front?

This is what my code looks like.


{include_php file="inc_mainnav.php"}


Nothing, its not showing at all!
When I try,


{php}
<? include('inc_mainnav.php'); ?>
{/php}


I get a php error blank page.

Can anyone shed some light on this?
Thanks

tj
08-16-06, 11:39 PM
Figured it out!



{include file="inc_mainnav.php"}


Dont use


{include_php}

amleth
08-18-06, 05:07 AM
tj,

another way to do it which will work, as i have done a similar thing is

{php} include('inc_file.php'); {/php}

in smarty templates you don't use <? and ?>

Regards,
Amleth Ojalen