View Single Post
  #5  
Old 08-07-2003, 08:53 AM
 
lyle lyle is offline
 

Member
  
Join Date: Aug 2003
Posts: 11
 

Default

kk
thanks and before i go too far into the depths of smarty stuff (really gotta get this site up

does this hold any water? am i on the right path at all with this post?
__________________________________________________ ______
AJ
Member



Joined: 17 Oct 2002
Posts: 25
Location: Marietta, Ohio
Posted: Fri Nov 22, 2002 11:35 am Post subject:

--------------------------------------------------------------------------------

Since I haven't seen anyone post a solution on this, I'll post a couple methods I'm using.

To include a php file in a Smarty .tpl file, just do this:

{include_php file="/pathtofile/file.php"}

This seems to work pretty well, assuming you don't need to use any variables from Smarty.

You can also use actual PHP code too! Just do it like this:

{php}
php code goes here;
{/php}

For this to work, you have to set the $php_handling variable to SMARTY_PHP_ALLOW in /Smarty-2.1.1/Smarty.class.php.

Hope that helps someone out there. Took me forever to figure it out. Now, if someone can tell me how to pass a Smarty-defined variable to an included PHP script, I'd love to hear it!
Reply With Quote