How does PHPBB do it?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
php_wiz_kid
Forum Contributor
Posts: 181
Joined: Tue Jun 24, 2003 7:33 pm

How does PHPBB do it?

Post by php_wiz_kid »

I was looking through the code and templates in phpbb and I was kind of wondering how they did this.


In a template file such as index_body.tpl for the site name they put {SITE_NAME} in the code and it prints in the browser yourdomain.com or whatever. How does phpbb do this without placing the php tags in the .tpl file? I also know that the constant SITE_NAME is defined in an external page somewhere. Do they have some type of parser that turns the template file into a php file? I've experimented a little and noticed that I can get this to work on my own pages if I add the php tags to the document. Thanks.
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Re: How does PHPBB do it?

Post by McGruff »

php_wiz_kid wrote:I was looking through the code and templates in phpbb and I was kind of wondering how they did this. Do they have some type of parser that turns the template file into a php file?
Yes: see includes folder, template.php
Post Reply