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
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
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.
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
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
In HMVC I can create 2 or more modules folders, as example: one in application directory and one in applicataion/third_party directory. Can your widget do the same thing? It would be nice if this feature applied in your widget. Thanks
I’ve put MY_Loader file from libraries to core folder, and changed “extends Model” to “extends CI_Model” but it still doesn’t work with my CI2.0. It still returns a blank page. i think the problem in library “widgets.php”. Can you re-upload your code for me? Thank you very much!