954,604 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Question about functions in various third party applications

Hey guys and gals,
I have a question that is bugging me because I can't seem to figure out how different php based applications achieve it (curiosity killed the cat right). My question is this, how does forum/cms/etc software utilize functions in their templates without using php code to wrap each function. For example, if you were to build a function in php it might look like so:

<html>
<body>

<?php
function writeName()
{
echo "Kai Jim Refsnes";
}

echo "My name is ";
writeName();
?>

</body>
</html>

(Credit to W3schools for this example)

But if you look at say phpbb in your template file you have all sorts of words wrapped in {}'s.....example:

<title>{SITENAME} &bull; <!-- IF S_IN_MCP -->{L_MCP} &bull; <!-- ELSEIF S_IN_UCP -->{L_UCP} &bull; <!-- ENDIF -->{PAGE_TITLE}</title>


Joomla on the other hand uses kind of a include type function to bring pieces of its template together.

So my question remains how do they embed these kind of sub-languages into their php applications, is it through a second language like xml? javascript? etc? Or is it just a lesson I have failed see?

PixelatedKarma
Junior Poster in Training
58 posts since Apr 2010
Reputation Points: 10
Solved Threads: 0
 

These are templates, they adhere to HTML. The snippet above shows 'placeholders' for data. Many of these types of templaters available. Have a look at Smarty or RainTPL. They don't look quite as freaky as phpBB though ;)

diafol
Rhod Gilbert Fan (ardav)
Moderator
7,800 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You