Include php file in tpl

Reply

Join Date: Nov 2004
Posts: 257
Reputation: sam1 is an unknown quantity at this point 
Solved Threads: 1
sam1's Avatar
sam1 sam1 is offline Offline
Posting Whiz in Training

Include php file in tpl

 
0
  #1
Apr 12th, 2009
hi,

Is there a way to include a php file in .tpl file.

basically i have a menu (javascript,html and css based) that i want to include in the .tpl file.

thanks
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 849
Reputation: pritaeas will become famous soon enough pritaeas will become famous soon enough 
Solved Threads: 138
Sponsor
pritaeas's Avatar
pritaeas pritaeas is offline Offline
Practically a Posting Shark

Re: Include php file in tpl

 
0
  #2
Apr 13th, 2009
"If it is NOT source, it is NOT software."
-- NASA
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 1
Reputation: Khusyal is an unknown quantity at this point 
Solved Threads: 0
Khusyal Khusyal is offline Offline
Newbie Poster

Include a php file in .tpl file

 
1
  #3
4 Days Ago
{php}
// including a php script directly
// from the template.
include("/path/to/display_weather.php");
{/php}
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 126
Reputation: muralikalpana is an unknown quantity at this point 
Solved Threads: 6
muralikalpana's Avatar
muralikalpana muralikalpana is offline Offline
Junior Poster
 
1
  #4
4 Days Ago
Originally Posted by sam1 View Post
hi,

Is there a way to include a php file in .tpl file.

basically i have a menu (javascript,html and css based) that i want to include in the .tpl file.

thanks
you could add the following to .htaccess -
  1. AddType application/x-httpd-php .tpl
As this will tell php to parse all .tpl files. Then you can include as much php code in those files as you want to.
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 849
Reputation: pritaeas will become famous soon enough pritaeas will become famous soon enough 
Solved Threads: 138
Sponsor
pritaeas's Avatar
pritaeas pritaeas is offline Offline
Practically a Posting Shark
 
0
  #5
4 Days Ago
@muralikalpana:
Actually, that will work if the file is called directly. In the case of Smarty however, this file is opened and parsed, so that won't work.
"If it is NOT source, it is NOT software."
-- NASA
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC