EllisLab text mark
Advanced Search
1 of 2
1
   
widget with CI loader
Posted: 19 July 2010 04:12 PM   [ Ignore ]
Avatar
Joined: 2008-09-11
758 posts

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

$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

 Signature 

CI,JQuery,Google Maps | widget with CI loader | Thumbnail, Image Resize, Image Crop Helper | CI shortcode

 
Posted: 19 July 2010 11:42 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Joined: 2009-10-07
10 posts

sorry my English.

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

 
Posted: 20 July 2010 01:40 PM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Avatar
Joined: 2008-09-11
758 posts

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.

 Signature 

CI,JQuery,Google Maps | widget with CI loader | Thumbnail, Image Resize, Image Crop Helper | CI shortcode

 
Posted: 30 July 2010 04:50 PM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Joined: 2010-07-30
1 posts

Pretty Handy I was looking for this. Note to make it work autoload: widgets

 
Posted: 30 July 2010 07:48 PM   [ Ignore ]   [ # 4 ]   [ Rating: 0 ]
Avatar
Joined: 2008-09-11
758 posts

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.

 Signature 

CI,JQuery,Google Maps | widget with CI loader | Thumbnail, Image Resize, Image Crop Helper | CI shortcode

 
Posted: 01 September 2010 10:23 PM   [ Ignore ]   [ # 5 ]   [ Rating: 0 ]
Avatar
Joined: 2008-03-19
163 posts

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

 Signature 

AutoACL - Access Control Library++ with Very Private Page (VPP) Control
AutoCRUMB - The simplest breadcrumb helper ever
Autocrumb on bitbucket
Integrate CI 2 with Eclipse
———————————————————————————————-
Website: ardinoto.blogspot.com

 
Posted: 02 September 2010 06:49 AM   [ Ignore ]   [ # 6 ]   [ Rating: 0 ]
Avatar
Joined: 2008-09-11
758 posts

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

 Signature 

CI,JQuery,Google Maps | widget with CI loader | Thumbnail, Image Resize, Image Crop Helper | CI shortcode

 
Posted: 27 September 2010 05:50 AM   [ Ignore ]   [ # 7 ]   [ Rating: 0 ]
Avatar
Joined: 2008-09-11
758 posts

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

$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

 Signature 

CI,JQuery,Google Maps | widget with CI loader | Thumbnail, Image Resize, Image Crop Helper | CI shortcode

 
Posted: 27 September 2010 06:31 AM   [ Ignore ]   [ # 8 ]   [ Rating: 0 ]
Avatar
Joined: 2007-06-11
2985 posts

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

 Signature 

————————
Blog | Twitter | GitHub | BitBucket
————————-
PyroCMS - open source modular CMS built with CodeIgniter
PancakeApp - Simple, hosted invoicing/w project management

 
Posted: 28 October 2010 11:28 PM   [ Ignore ]   [ # 9 ]   [ Rating: 0 ]
Avatar
Joined: 2010-07-05
7 posts

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.

 
Posted: 29 October 2010 03:46 PM   [ Ignore ]   [ # 10 ]   [ Rating: 0 ]
Avatar
Joined: 2008-09-11
758 posts

let me check with C1 2.0 will update you

 Signature 

CI,JQuery,Google Maps | widget with CI loader | Thumbnail, Image Resize, Image Crop Helper | CI shortcode

 
Posted: 29 October 2010 05:08 PM   [ Ignore ]   [ # 11 ]   [ Rating: 0 ]
Avatar
Joined: 2008-09-11
758 posts

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

 Signature 

CI,JQuery,Google Maps | widget with CI loader | Thumbnail, Image Resize, Image Crop Helper | CI shortcode

 
Posted: 30 October 2010 01:30 PM   [ Ignore ]   [ # 12 ]   [ Rating: 0 ]
Avatar
Joined: 2010-06-27
134 posts

good job mate, will be integrating the changes at some point today.

 Signature 

“I Reject Your Reality and Substitute My Own” - Adam Savage, M5 Inc

 
Posted: 31 October 2010 11:27 PM   [ Ignore ]   [ # 13 ]   [ Rating: 0 ]
Avatar
Joined: 2010-07-05
7 posts
umefarooq - 29 October 2010 09:08 PM

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

Thanks. I’ll try it

 
Posted: 01 November 2010 02:18 AM   [ Ignore ]   [ # 14 ]   [ Rating: 0 ]
Avatar
Joined: 2008-03-19
163 posts

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

 Signature 

AutoACL - Access Control Library++ with Very Private Page (VPP) Control
AutoCRUMB - The simplest breadcrumb helper ever
Autocrumb on bitbucket
Integrate CI 2 with Eclipse
———————————————————————————————-
Website: ardinoto.blogspot.com

 
Posted: 08 November 2010 08:02 AM   [ Ignore ]   [ # 15 ]   [ Rating: 0 ]
Avatar
Joined: 2010-07-05
7 posts

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!

 
1 of 2
1