Codeigniter: Best way to structure partial views

thekidloveu

New Member
How would you structure the below page in Codeigniter?
7vHtF.png
I thought about creating seperate controllers for each section[*]Left nav[*]Content nav[*]Login name[*]LeaderboardExcluding the content section (as this changes depending on the link on the left nav and content nav used as a kinda sub-menu). All the other sections remain roughly the sameI thought about doing:\[code\]Class User_Profile extends Controller{ function index() { $this->load_controller('Left_Nav'); $this->load_controller('Content_Nav'); $this->load_controller('Login_Name'); $this->load_controller('Leaderboard', 'Board'); $this->Left_Nav->index(array('highlight_selected_page' => 'blah')); $this->load('User'); $content_data = http://stackoverflow.com/questions/3675135/$this->User->get_profile_details(); $this->view->load('content', $content_data); $this->Login_Name->index(); $this->Board->index(); }}\[/code\]Obviously this \[code\]load_controller\[/code\] does not exist but this functionaility would be useful. The controller for each section gets the data required from the model and then loads the page through \[code\]$this->view->load()\[/code\]It could be a headache to have this code in all the left nav links like News, Users, About Us, etc.. But then again not every nav link has all those sections so I need that flexability of having the sections as a "partial view"Can anyone suggest a better way of doing this?
 
Back
Top