I've recently tried to design a template system but things haven't ran so smoothly. This is my first time btw,
Im using different methods to display different parts of my site ... ie, Header method to display the <html> tag through to <body> tag... etc..
In the end i just use another method (Display()) to call on them.
The problem I have is I can't use a variable from by body to the <title></title> tags becasue the header method is excuted first, then the body method is excuted.
Anyone have any way to go by this? I've been thinking about formatting my page first and put the output it in a variable or something... and then call the display() function so that I already have what I want in the <title> tags ready.
Help Plz... ~~~ Me a design noob
Also, do you know any gd place to find stuff about CMS designs? preferrably using objects...
Thnx ALOT
LeXon
Page Template Design Problems
Moderator: General Moderators
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
How I accomplished this in the past is by combining the header content page and footer before processing
semi pseudo:
then I can do the variable processing
semi pseudo:
Code: Select all
$loadTemplates = array(
'header.tpl',
$requestedTemplate.'.tpl',
'footer.tpl'
);
$overallTemplate = '';
foreach ($loadTemplates as $template) {
$file .= file_get_contents($template);
}