My next step in php is to tro to learn how to use a template system. by this i mean where i can have a page called index.php and the design would be determined by index.tpl
Then id like to be able to do what phpbb templates do and have {SOMETHING_COOL} to display a certain text or item.
It's quite simple Python, basically you load the file (ie. 'index.tpl') then search for {SOMETHING_COOL} and replace it with "Something else". For example:
yeah. ill have a quick search on google sometime for a more detaled tutorial on it. because it would be really cool if i could make it based on language files too
hey thats for those discriptions i have been learning php for some time my forum is http://www.zackszone.com so im going to be making some things for a new site
Hey Python i wasnt trying to spam i was sent here but a freind thats builds websites and i was reading about php and saw this and it helped me with the site im putting to gether
sorry if you though it was spaming i will not do it again
Python, I've been looking for this sort of a thing for a while and never thought to ask. Thanks for posting the thread, and I'll be sure to read it when I start learning a little more PHP; at the moment I probably could understand it, I'm just not willing to without being in must-learn-PHP-mode.
Check out the articles on Devshed.com, there is a five part series on there about building a site engine CMS, its a little incomplete but it has a lot of good ideas. I am working a version at the moment using PHP 4. Templates are XML based so I am writing a parser that emulates the simpleXML functionality in PHP5.
Comments
not sure if they have any but they have tutorials for pretty much everything else
The Royal Ram
[code:1:f73c78e1e3]$tpl = file_get_contents('index.tpl');
$tpl = str_replace('{SOMETHING_COOL', 'Something else', $tpl);
echo $tpl;[/code:1:f73c78e1e3]
Of course, you'd probably stick this into a class of some sort.
Webmaster-Talk.com
Chroder.com
The Royal Ram
[code:1:51e8a5b040]$lang = array('hello' => 'Hello', 'welcome' => 'Welcome to DD', 'time' => 'It\'s time again!');
foreach($lang AS $k => $v)
{
$tpl = str_replace("{LNG.$k}", $v, $tpl);
}
echo $tpl;[/code:1:51e8a5b040]
So in that example, {LNG.hello} would be replaced with 'Hello' etc.
Webmaster-Talk.com
Chroder.com
thanks for joining in and posting but it would be better if you didnt spam.
The Royal Ram
sorry if you though it was spaming i will not do it again
i wont count it against you
so why dont you introduce yourself. maybe even get some reviews on your site at our reveiws section
The Royal Ram
Python, I've been looking for this sort of a thing for a while and never thought to ask. Thanks for posting the thread, and I'll be sure to read it when I start learning a little more PHP; at the moment I probably could understand it, I'm just not willing to without being in must-learn-PHP-mode.
Host Assessment | Tetris | Blog | Great Big Blog
Buy Video Games | Nathan
Video Game Cheats Hints Codes | Click Joke | Game Livewire
Host Assessment | Tetris | Blog | Great Big Blog
Buy Video Games | Nathan
Video Game Cheats Hints Codes | Click Joke | Game Livewire
Hmm, phpBB has no split feature apparently.
Webmaster-Talk.com
Chroder.com
its does its just i havent got a clue how to split topics, hehe.
ill learn soon
plus your a mod
The Royal Ram
Check out the articles on Devshed.com, there is a five part series on there about building a site engine CMS, its a little incomplete but it has a lot of good ideas. I am working a version at the moment using PHP 4. Templates are XML based so I am writing a parser that emulates the simpleXML functionality in PHP5.
Cheers
Simon