Jump to content

Recommended Posts

Hello everyone and Happy New Year

 

I need from one of you experienced php/MySQL developers to point me in the right direction. I need to learn how to create a php or php/MySQL template. Any tutorials out there or books that I can buy. I've been scowering the net but haven't really found something that explains this to me. Most seem to assume that the reader has experience with OOP, which I don't.

 

I consider my self in terms of experience with php/MySQL to be in the middle of novice/intermediate.

 

I've seen around the internet url's such as these

 

"http://domain.com/index.php?file=aboutus.php"

 

or

 

"http://domain.com/page.php?pid=2"

 

that reads of the MySQL database. I need to be able to associate sub menu links based on the section that has been selected etc.

 

Any help is greatly appreciated.

Link to comment
https://forums.phpfreaks.com/topic/139742-help-new-to-php-templating/
Share on other sites

its quite simple really.

 

functions.php:

$header = "
<table>
<tr>
<td>
";

$footer = "
</td>
</tr>
</table>
";

 

index.php:

include("functions.php");
echo $header;
echo "Hello world";
echo $footer;

 

 

This is a very crude example, but its essentially a matter of having a header and a footer that will wrap around data.

Smarty is not a very good templating system in my opinion... a lot of problems with the template system running very slow. Caching problems that is

 

Templating, itself, is a big debate. It all depends on the type of application you want, whether or not Smarty would be good for you.

 

For a system that say allows a user to create their own template, where you do not want to allow access to certain php functions, and frankly do not want them to use php at all, that is what Smarty imo was designed for.

 

For the regular site, yea go berserk on using php files with php code to template it, but for user template interaction, it does provide a barrier net and yes a user has to learn to use the right tags, but I would rather have them do that than just all them to code in PHP.

 

Anyhow, there may be better alternatives to smarty, that was just an example.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.