Organizational Research By

Surprising Reserch Topic

how to create a widget system in codeigniter


how to create a widget system in codeigniter  using -'php,codeigniter,hmvc'

I am creating a custom CMS in Codeigniter and I'd like to have a widget system similar to what is used in Wordpress.

For example, I'd like to have a widget that shows the last 5 posts displayed on the sidebar. I'd also like to be able to control what pages this widget appears on page-by-page basis.

I am using Phil Sturgeon's Template library, so an example controller looks like:

$this->template->set_partial('header', 'layouts/header');
$this->template->set_partial('footer', 'layouts/footer');
$this->template->set_partial('sidebar', 'layouts/sidebar');

$this->data['title'] = "Create Post";
$this->template->build('create', $this->data);


I'd like to stick with the MVC pattern, so I don't want to put logic in the sidebar view, which is the only thing I can think of right now.

Is HMVC something I should be using for this?

How can I tell the sidebar which widgets to display?
    
asked Sep 15, 2015 by KerPriestle
0 votes
29 views



Related Hot Questions



Government Jobs Opening


...