How to create sidebar widgets/modules i.e. embedding the contents of another controller in a view |
[eluser]design_shuffle[/eluser]
Hi, I have been tearing my hair out over this for about 3 hours, please can someone help? Here is what I want to achieve... On my home page I wish to have a sidebar widget/module which displays the latest 10 events from the events controller. I started off trying to use the widget plugin, but could not get my head around it -Plugin widget Next I read about extending the standard controller to MY_Controller, so in the MY_Controller I added the code from my events controller which retrieves the latest events using the events model, I presume this is the correct place to put this? ##contents of MY_Controller Code: function home_events() Next in my home view I try and load the home_events_view with the following - Code: <?php echo $home_events_view; ?> When I load the homepage I get the following error - Message: Undefined variable: home_events_view Filename: views/home.php Have I approached this the correct way?, can anyone spot where I have gone wrong? Im guessing that I need to put something in my home controller to retrieve the events data? Any help would be appreciated, I have learnt so much lately about codeigniter and I love it, but embedding views has been a big snag! Thanks Dan |
Messages In This Thread |
How to create sidebar widgets/modules i.e. embedding the contents of another controller in a view - by El Forum - 07-21-2010, 03:35 PM
How to create sidebar widgets/modules i.e. embedding the contents of another controller in a view - by El Forum - 07-21-2010, 03:41 PM
How to create sidebar widgets/modules i.e. embedding the contents of another controller in a view - by El Forum - 07-21-2010, 09:30 PM
How to create sidebar widgets/modules i.e. embedding the contents of another controller in a view - by El Forum - 07-22-2010, 12:33 AM
How to create sidebar widgets/modules i.e. embedding the contents of another controller in a view - by El Forum - 07-22-2010, 02:49 AM
How to create sidebar widgets/modules i.e. embedding the contents of another controller in a view - by El Forum - 10-02-2010, 06:29 PM
How to create sidebar widgets/modules i.e. embedding the contents of another controller in a view - by El Forum - 10-02-2010, 06:41 PM
|