nepzap2 Posted January 6, 2009 Share Posted January 6, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/139742-help-new-to-php-templating/ Share on other sites More sharing options...
premiso Posted January 6, 2009 Share Posted January 6, 2009 Why not use an already made system such as Smarty ? Quote Link to comment https://forums.phpfreaks.com/topic/139742-help-new-to-php-templating/#findComment-731125 Share on other sites More sharing options...
dennismonsewicz Posted January 6, 2009 Share Posted January 6, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/139742-help-new-to-php-templating/#findComment-731127 Share on other sites More sharing options...
Gighalen Posted January 6, 2009 Share Posted January 6, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/139742-help-new-to-php-templating/#findComment-731128 Share on other sites More sharing options...
premiso Posted January 6, 2009 Share Posted January 6, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/139742-help-new-to-php-templating/#findComment-731134 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.