pascal_22 Posted August 14, 2013 Share Posted August 14, 2013 Hello all! I have a website with around 250 pages. in every pages(login,index,search,contact....... and all others..) all are in this structure: example: index.php <html> <head><title></title>all others thing that goes here</head> <body> <div><?php include 'topmenu.php'; ?> </div> <div><?php include 'leftmenu.php'; ?> </div> <div>//content of active page</div> <div><?php include 'footer.php'; ?> </div> </body> </html> So here are only a short display but the important fact is.. on all main pages as:home,contact,member contact, members profile,... and such a lot more all have there own tags (html,head,body......) So whe n i change my design or other.. i have to pass all pages!!!!! And i suppose isn't the best way. What do you suggest to me! thanks! Quote Link to comment Share on other sites More sharing options...
gristoi Posted August 14, 2013 Share Posted August 14, 2013 I would advise you looking a using a templating engine (something like twig) or shift your site into an MVC framework which will mean only 1 master template to worry about Quote Link to comment Share on other sites More sharing options...
pascal_22 Posted August 14, 2013 Author Share Posted August 14, 2013 thansk for answer... i'm realy new in template.... a saw that i sould install twig.... after installing.. what happen.. it will check my page and create template...? thanks for your help! Quote Link to comment Share on other sites More sharing options...
pascal_22 Posted August 14, 2013 Author Share Posted August 14, 2013 for exemple: in my index.php: <?php include 'header.php';//that will contents <html> and head tag..... include 'leftmenu.php'//content menu and bddy tag...... //here the content of the page include 'footer.php';//centent </body> and </html> ?> is it that? thanks Quote Link to comment Share on other sites More sharing options...
jazzman1 Posted August 14, 2013 Share Posted August 14, 2013 (edited) This is a good example of a full working PHP application using Smarty. Try to understand how to separate your presentation and logic. Once you got the idea, you could jump over twig and try to create the same app using twig. Edited August 14, 2013 by jazzman1 Quote Link to comment 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.