CodeIgniter Forums
widget with CI loader - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: widget with CI loader (/showthread.php?tid=32300)

Pages: 1 2 3


widget with CI loader - El Forum - 07-19-2010

[eluser]umefarooq[/eluser]
if we can load libraries, helper with CI loader why not widget with CI loader, so i played little with library function of CI loader and create widget function now you can load widget same as library, helper or view

Code:
$this->load->widget('widget_name');
echo $this->widget_name->run();

widget will return output you can print in you main layouts. check out attachment, need some comments from CI community.

Edited Modular widgets

Modular widgets will work with modular separation(HMVC) just you have to create widgets folder in module folder widget will be call in same way, now you can access model and views of same module with CI loader no need to create view or model folder in widgets with old version

guys please find widgets on this link

widget with CI loader


widget with CI loader - El Forum - 07-19-2010

[eluser]chonlatee[/eluser]
sorry my English.

oh it useful but how to different from library or helper.


widget with CI loader - El Forum - 07-20-2010

[eluser]umefarooq[/eluser]
First these widget you can use as view partials. these widget can work like wordpress plugins, also these widget can access all CI libraries for different functionality, like getting records or database driven menus with these widgets.


widget with CI loader - El Forum - 07-30-2010

[eluser]Unknown[/eluser]
Pretty Handy I was looking for this. Note to make it work autoload: widgets


widget with CI loader - El Forum - 07-30-2010

[eluser]umefarooq[/eluser]
Thanks for linking it i need CI community to have look on the code need more improvement in it i just created in rush, i will also try to make it more and more improved and will share also.


widget with CI loader - El Forum - 09-01-2010

[eluser]ardinotow[/eluser]
Thanks for this library. One question, can I also load a model inside my widget folder as well as load view folder ?


widget with CI loader - El Forum - 09-02-2010

[eluser]umefarooq[/eluser]
well for this you have create model function in MY_Loader class to load model from widget folder, but you can also use root model folder to access you model for widget. well tanks for liking this library


widget with CI loader - El Forum - 09-27-2010

[eluser]umefarooq[/eluser]
here is new version for widget load with CI loader,now you can parser your widget views if you are using some template parser like @phil Dwoo template parser or simple CI parser, now you can also use widget models every widget will have its own separate model to access database check out sample widget in zip file

sample code to load model and enabling parser

Code:
$this->model('model_name');
  $this->model_name->get_query();
  
  enable parser just make it true in widget

  $this->parser_enable = TRUE;

looking forward updates from users any bug or problem


widget with CI loader - El Forum - 09-27-2010

[eluser]Phil Sturgeon[/eluser]
Some of that code looks pretty familiar. It looks like this code will be compatible with my Widgets for PyroCMS/EE?


widget with CI loader - El Forum - 10-28-2010

[eluser]hungnm144[/eluser]
Thanks for your code. Great! I really like it. But, I'm having a problem with CI 2.0
I can't load widget. not work. It returns a blank page. Sad I'm still trying to find the cause.