FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


The .tpl mess





rohan2kool
I looked into the source of phpbb and i found many .tpl files. What are these for? I know it's for the skins, but how does it work. How does the phpbb template engine render them?? I wud like it if anyone cud tell me dat or guide me to a page.

Also, what is the use of '->' and '=>' in php?
Stubru Freak
rohan2kool wrote:
I looked into the source of phpbb and i found many .tpl files. What are these for? I know it's for the skins, but how does it work. How does the phpbb template engine render them?? I wud like it if anyone cud tell me dat or guide me to a page.

Also, what is the use of '->' and '=>' in php?


I suppose they're included somehow.

And the => is for classes if I'm not wrong.
BlackSkad
They take the content of the .tpl files (probably with the file()-function, but I'm not sure). Then they replace the {tag}-parts, with the corresponding values, which they have computed before (from mysql or other sources).

The "->"-operator is used with classes. In both examples below, $object is an instance of a certain class with certain member-functions and instance-variables. To call, as example, the instance-variable $foo outside the class, you use the first way. Calling a member-function boo() takes the same syntax (2).

Code:
1) $object->foo
2) $object->boo()


The => is used with arrays. With the =>, you can use specific keys instead of just numbers. Check the example below. The array $examp now holds a key 'Nonsense', which is corresponding with the value 'Rubbish'. The second line then will output 'Rubbish' to the screen.

Code:
$examp = array ('Nonsense' => 'Rubbish')
echo $examp['Nonsense'];


I hope you understand it. If not, search some information about it, because these things are also frequently used in the SrinJado project. Succes

BlackSkad
polarBear
TPL file extension is used to indicate 'templates' as in 'code chunks that are parsed, modified, and outputted on the fly'. It's not only for skins, the entire 'seeable' forum is composed of several templates.

The ->operator is used to call methods and properties from an object. As for the =>, I've never used it in my entire life, so I don't know...


edit I just found out it's used to manipulate arrays.
This article:
http://ar2.php.net/manual/en/language.types.array.php#language.types.array.syntax
has more details on it.
n0obie4life
index_body.tpl - for the index.php page
overall_header.tpl - for the header, the "log out, pm, profile" and etc.
overall_footer.tpl - the bottom..

and much more.

http://www.phpbb.com/kb/article.php?article_id=198
Related topics
Mess.be Thumbnail files
display pictures from www.MESS.be
Problems at Battlefield 2 !!!!
Request viewtopic_quickreply.tpl file for $$
Account troubles
Placement of ads in the forums
Mess.be
Question
mtv is officially a mess
Help Needed with phpBB overall_header.tpl
Dog Mess...
What is your operating system?
graphic formats
do you like Rock or Rap?
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.