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.
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.
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
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. :( I’m still trying to find the cause.
its working fine with CI2 also i have checked that for CI2 you have to put MY_Loader file from libraries to core folder, and for model you have to extend with CI_Model its working really fine
its working fine with CI2 also i have checked that for CI2 you have to put MY_Loader file from libraries to core folder, and for model you have to extend with CI_Model its working really fine
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!