943,514 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 4764
  • PHP RSS
Apr 12th, 2009
0

Include php file in tpl

Expand 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
Similar Threads
Reputation Points: 10
Solved Threads: 1
Posting Whiz
sam1 is offline Offline
300 posts
since Nov 2004
Apr 13th, 2009
0

Re: Include php file in tpl

Sponsor
Featured Poster
Reputation Points: 549
Solved Threads: 722
Bite my shiny metal ass!
pritaeas is offline Offline
4,155 posts
since Jul 2006
Nov 30th, 2009
1

Include a php file in .tpl file

{php}
// including a php script directly
// from the template.
include("/path/to/display_weather.php");
{/php}
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Khusyal is offline Offline
1 posts
since Nov 2009
Nov 30th, 2009
0
Re: Include php file in tpl
Click to Expand / Collapse  Quote originally posted by sam1 ...
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 -
PHP Syntax (Toggle Plain Text)
  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.
Reputation Points: 21
Solved Threads: 35
Posting Pro
muralikalpana is offline Offline
534 posts
since Sep 2009
Nov 30th, 2009
0
Re: Include php file in tpl
@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.
Sponsor
Featured Poster
Reputation Points: 549
Solved Threads: 722
Bite my shiny metal ass!
pritaeas is offline Offline
4,155 posts
since Jul 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Arrays -> pulling information from a database
Next Thread in PHP Forum Timeline: how to browse a file without showing input type as file on frontpage





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC