1 Replies - 1882 Views - Last Post: 08 February 2006 - 11:36 PM Rate Topic: -----

#1 capty99  Icon User is offline

  • i am colt mccoy
  • member icon

Reputation: 99
  • View blog
  • Posts: 10,081
  • Joined: 26-April 01

Include Files and Templates

Posted 08 February 2006 - 07:40 PM

so ive got this site here
its this complanies pre existing code and im just adding my update to make it easier for them to work on, right now, its all html editing to do any changes, so this way, im just implementing a lil php management system, but i cant get it to work properly. im just trying to simply include one page into another, and then the 2nd page into a third.

this page is the generated php page with the press releases.

this page is the pre-existing press release page, but ive taken out where there used to be the releases and just done an include pointing at that first page.

this last page is the final page that has all these templates etc... that have been set up by the sites original programmer, and that i dont know how to navigate exactly,
but ,
all it should be doing is calling the 2nd link and formatting it, for some reason it gets rid of the php part of the 2nd link.
// this is the code for the third page, the final product

$tpl = new Template;
$tpl->set('content', $tpl->fetch('index.php'));
$tpl->set('page_title', 'Welcome to Airimba Wireless');
$tpl->set('base_url', $cfg['base_url']);
$tpl->set('base_urls', $cfg['base_urls']);
print $tpl->fetch('master.html');


note the line
$tpl->set('content', $tpl->fetch('index.php'));

thats all ive changed on this page,
it originally was index.html,
so im assuming that this template just has a problem with php or something.

any ideas?
need more info let me know. im sure i didnt explain it well enough.

Is This A Good Question/Topic? 0
  • +

Replies To: Include Files and Templates

#2 snoj  Icon User is offline

  • Married Life
  • member icon

Reputation: 93
  • View blog
  • Posts: 3,583
  • Joined: 31-March 03

Re: Include Files and Templates

Posted 08 February 2006 - 11:36 PM

I take it that the template index.php contains PHP code? If so, the template system is just getting the file's contents. That is, using something like file_get_contents() on it.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1