tefuzz Posted February 24, 2009 Share Posted February 24, 2009 too hard to put together for a novice php coder? Quote Link to comment https://forums.phpfreaks.com/topic/146760-is-a-template-driven-site-in-php/ Share on other sites More sharing options...
rhodesa Posted February 24, 2009 Share Posted February 24, 2009 Check out Smarty: http://www.smarty.net/ easy to setup and use Quote Link to comment https://forums.phpfreaks.com/topic/146760-is-a-template-driven-site-in-php/#findComment-770499 Share on other sites More sharing options...
blueman378 Posted February 24, 2009 Share Posted February 24, 2009 although for small projects it becomes a bit much... Quote Link to comment https://forums.phpfreaks.com/topic/146760-is-a-template-driven-site-in-php/#findComment-770511 Share on other sites More sharing options...
premiso Posted February 24, 2009 Share Posted February 24, 2009 PHP in itself is a templateing engine. No need to use a template system, when php already is one. Quote Link to comment https://forums.phpfreaks.com/topic/146760-is-a-template-driven-site-in-php/#findComment-770558 Share on other sites More sharing options...
tefuzz Posted February 24, 2009 Author Share Posted February 24, 2009 PHP in itself is a templateing engine. No need to use a template system, when php already is one. yea, my project is small so all im really looking for is how to create a function to load a header, content area, and a footer into my index page so i dont have cluttered code on the main page...is it as simeple as just throwing in a <?php include ('header.php'); ?> where I want my header to be? Quote Link to comment https://forums.phpfreaks.com/topic/146760-is-a-template-driven-site-in-php/#findComment-770584 Share on other sites More sharing options...
trq Posted February 24, 2009 Share Posted February 24, 2009 PHP in itself is a templateing engine. No need to use a template system, when php already is one. yea, my project is small so all im really looking for is how to create a function to load a header, content area, and a footer into my index page so i dont have cluttered code on the main page...is it as simeple as just throwing in a <?php include ('header.php'); ?> where I want my header to be? Yes, though apache has ssi if this is all your planning on using php for. Quote Link to comment https://forums.phpfreaks.com/topic/146760-is-a-template-driven-site-in-php/#findComment-770607 Share on other sites More sharing options...
Darklink Posted February 24, 2009 Share Posted February 24, 2009 Wherever you want code, just add PHP into your HTML with the opening and closing tags of course. It's quicker and more flexible than using any template system. The only downfall is clutter in your HTML, but you can sort this out by understanding PHP syntax a little more to neaten it up a bit. Quote Link to comment https://forums.phpfreaks.com/topic/146760-is-a-template-driven-site-in-php/#findComment-770648 Share on other sites More sharing options...
tefuzz Posted February 25, 2009 Author Share Posted February 25, 2009 Wherever you want code, just add PHP into your HTML with the opening and closing tags of course. It's quicker and more flexible than using any template system. The only downfall is clutter in your HTML, but you can sort this out by understanding PHP syntax a little more to neaten it up a bit. I have decided this would be the best route...it's really not a template system but an ease of use system. I want to run the entire page off the index, so having the header and footer added with only 2 lines of code is a big space savings in the index. Quote Link to comment https://forums.phpfreaks.com/topic/146760-is-a-template-driven-site-in-php/#findComment-770699 Share on other sites More sharing options...
chronister Posted February 25, 2009 Share Posted February 25, 2009 Take a look at this topic. I posted in it regarding a "template" type layout. http://www.phpfreaks.com/forums/index.php/topic,230941.msg1070233.html#msg1070233 I have 1 page that is my layout page. It includes all my head information (e.g. css, js ), my header, navigation, and my footer. I then call that page inside each page of my site to "wrap" around my content and have a nice "template" type of layout. When I want to change anything such as header, navigation footer etc, I do it on 1 page only. Works well. I like it and I use it every site I build anymore. *note*, I saw an error in my post. I called the container page index.php, but I actually call it header.php Quote Link to comment https://forums.phpfreaks.com/topic/146760-is-a-template-driven-site-in-php/#findComment-770745 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.