widget with CI loader |
[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'); 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
[eluser]chonlatee[/eluser]
sorry my English. oh it useful but how to different from library or helper.
[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.
[eluser]Unknown[/eluser]
Pretty Handy I was looking for this. Note to make it work autoload: widgets
[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.
[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 ?
[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
[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'); looking forward updates from users any bug or problem
[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?
[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. ![]() |
Welcome Guest, Not a member yet? Register Sign In |