|
Comments for: david20000512
| Message # 1025191: |
|
Date: 04/17/05 17:55
By: JaseTaylor Subject: PHP and HTML sorted Ok, i've been looking at the articles wondering "o no. for my php code to work at all do i need to get some inside a template?" answer obviously no. Basically in either phplib or fasttemplate set ur {} tags in the array to a variable. eg {contents} => $contents There we go, we have a variable waiting to receive data. now on each page you writing php for, do the template parsing AT THE END. write all your php for the page first and then parse the template at the end of the code. this way u can set $contents to say $contents = 'this is a test'; And voila, it'll appear in the final product Not hard hard guys. if ur bothered about copying and pasting code like a session or user check for every page I have a simple solution, rather than trying to fit the damn thing into the template, do an include at the start of each page. here's layout i use <?php //includes like sessions checks //All script needed here like checking database etc //define variable eg $content = from code above ?> <?php //Then the template parser ?> job done |
Previous Message | Next Message |


