Creating a PHP Template Engine
Uploader Comments (HCodeEntertainment)
All Comments (12)
-
So... Trying to add if/else statements into my default.tpl file to render different div tags for layout based off if the page is index, 2 column or three column but maybe that's not where it goes? Any clues on how to add the if else statements to format the .tpl file layout? Thank you!
-
please.. your current one only shows how to add text as many times as you want, but not other more dynamic elements like a form or how to include more files than just index.php and defult.tpl.. I am attempting my first cms and simplicity in templateing it is key, as you can imagine the templates need more than just an index.php
-
great tut, is there a way you can use the same technique to call something like a form ?.. for example [form] could call a contact form.. thanks
Yes you can have it call. Form. Or what you could do is have it being. Form builder. [Form] [INPUT]. There are so many different ways of doing so. If you need a tut on this just let me know.
HCodeEntertainment 9 months ago
how about blocks?
dzMONEYy 10 months ago
@dzMONEYy what about blocks?
HCodeEntertainment 10 months ago
@HCodeEntertainment
if i want to use loops and lists...
dzMONEYy 10 months ago
@dzMONEYy
You can implement loops and lists. It's only a matter of stripping the tags then checking what its use is (ex. Loops and stuff.) Then getting all the content from inside the tags, placing them in variables replacing the tags with the actual loop. Many ways of accomplishing this sort of thing.
HCodeEntertainment 10 months ago
Thanks for the tut!
Josperdb 1 year ago
@Josperdb Your Welcome!
HCodeEntertainment 1 year ago