Cobby Posted August 24, 2007 Share Posted August 24, 2007 Hi all, I have been doing procedural all my PHP life, and have just grasped the basics of OOP and Smarty (template engine). I know want to utilize these in my projects. I have been looking at how phpBB forums work, and the way I understand it, every page is made up from 5 different pages: -A config file -PHP code file -Header template -Content template -Footer template Is this the best way to do it? I also noticed that in some places they have used OOP, how do I integrated procedural and OOP? Cheers, Cobby Link to comment https://forums.phpfreaks.com/topic/66484-managing-web-applications/ Share on other sites More sharing options...
Cobby Posted August 24, 2007 Author Share Posted August 24, 2007 Another questions, when referring to another page, is there a better alternative to: <?php header("Location: <web address>"); ?> Because as you well know, you cant have started rendering html to call that function, which means: <?php if($page == "refer"){ header("Location: <web address>"); }elseif($page == "page"){ include 'header.php'; echo "Page."; include 'footer.php'; }else{ include 'header.php'; echo "Another page."; include 'footer.php'; } ?> Instead of having: <?php include 'header.php'; if($page == "refer"){ header("Location: <web address>"); }elseif($page == "page"){ echo "Page."; }else{ echo "Another page."; } include 'footer.php'; ?> Is there a way to do this? Cheers, Cobby Link to comment https://forums.phpfreaks.com/topic/66484-managing-web-applications/#findComment-332894 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.