Welcome Guest, Not a member yet? Register   Sign In
What is the shortest and best way to do this
#1

[eluser]miauksius[/eluser]
Hi,

I'm creating a blog. Now, my layout is divided to four parts:
header.php
main_content.php - blog articles are shown here, ant this is area where main content is shown
sidebar.php - some boxes with info, links
footer.php

So, my main page shows blog articles. I fetch all them in my controller and model, also I have a box in sidebar, where I display latest 5 blog articles. So I catch five blog articles for main_content.php and catch five titles for sidebar.php. I have a page called 'About', well, method, and when I display some content there, I still use sidebar (it will always be shown), and every single time, when I include sidebar.php I have to pass to it array with those 5 articles titles. How can I avoid doing that?


Messages In This Thread
What is the shortest and best way to do this - by El Forum - 03-11-2012, 08:07 AM
What is the shortest and best way to do this - by El Forum - 03-11-2012, 08:20 AM



Theme © iAndrew 2016 - Forum software by © MyBB