Part of the EllisLab Network
   
4 of 12
4
Wick 0.91 - Discontinued
Posted: 29 May 2008 07:40 AM   [ Ignore ]   [ # 31 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  369
Joined  06-16-2006

Most of the uri functions in codeigniter works with arrays as well.

I believe $this->load->sub_controller() would make more sense if the function returned a reference to the controller and you could call whatever methods from it you would like. But seeing as the function executes the code specific to a given uri, i think $this->load->uri makes more sense.

Anyway I’m gonna put a variable in Wick class that holds the method-name (with ‘uri’ as default) - that way you can alter it if you wish.

 Signature 

Best regards. Zacharias.
Matchbox (Modular Separation) | Wick (Controller Loader)

Profile
 
 
Posted: 29 May 2008 07:42 AM   [ Ignore ]   [ # 32 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  593
Joined  02-04-2008

Personally I like just $this->load->controller();. Think a about views, you do not use load->sub_view when loading a view inside another view. load->uri does make sense when passing a uri segment thou.

Profile
 
 
Posted: 29 May 2008 07:48 AM   [ Ignore ]   [ # 33 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  369
Joined  06-16-2006

The problem with $this->load->controller, is that it overlaps with an existing method (in PHP4), which is why I can’t use it.

 Signature 

Best regards. Zacharias.
Matchbox (Modular Separation) | Wick (Controller Loader)

Profile
 
 
Posted: 29 May 2008 07:51 AM   [ Ignore ]   [ # 34 ]  
Grad Student
Rank
Total Posts:  85
Joined  08-23-2007

Anyway I’m gonna put a variable in Wick class that holds the method-name (with ‘uri’ as default) - that way you can alter it if you wish.

smile Your trademark: highly configurable code (e.g. Matchbox where you can have an array of module folders), I like that!

Profile
 
 
Posted: 29 May 2008 08:01 AM   [ Ignore ]   [ # 35 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  369
Joined  06-16-2006

Glad to hear people like it. wink However, I’m not going to put it in a config file (which is slightly overkill for a single configurable variable), only if more stuff end up being configurable. So for now you’ll have to edit the variable directly in the library file.

 Signature 

Best regards. Zacharias.
Matchbox (Modular Separation) | Wick (Controller Loader)

Profile
 
 
Posted: 29 May 2008 08:07 AM   [ Ignore ]   [ # 36 ]  
Grad Student
Rank
Total Posts:  85
Joined  08-23-2007

That’s just fine!

Profile
 
 
Posted: 29 May 2008 08:09 AM   [ Ignore ]   [ # 37 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  369
Joined  06-16-2006

Hm, I’m thinking about hooks, specifically the pre_controller, post_controller_constructor and post_controller hooks. Should they be called when loading a sub-controller?

 Signature 

Best regards. Zacharias.
Matchbox (Modular Separation) | Wick (Controller Loader)

Profile
 
 
Posted: 29 May 2008 08:33 AM   [ Ignore ]   [ # 38 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  369
Joined  06-16-2006

Okay I’ve just uploaded Wick 0.80, which introduces several new features and bugfixes:
* IMPORTANT: Changed method from $this->load->controller to $this->load->uri (the method name is now also configurable)
* Unlimited nesting of controllers (watch out for endless loops smile )
* 404 message if loading default controller and it doesn’t exist
* Data from original Loader class is now transfered to Wick_loader class upon initialization
* Same controller can be loaded twice (e.g. multiple methods from same controller)
* Additional 404 checks (for private underscored methods, and methods inherited from controller parent class).
* Loader class is consistent (not reset for each controller)
* You can now use the _remap function.
* Parameters are now passed to the controller and it’s methods.

Grab the new version here.

Enjoy! smile

 Signature 

Best regards. Zacharias.
Matchbox (Modular Separation) | Wick (Controller Loader)

Profile
 
 
Posted: 31 May 2008 01:27 PM   [ Ignore ]   [ # 39 ]  
Grad Student
Rank
Total Posts:  47
Joined  11-25-2007

Zacharias! you are Star *

This is Excellent. Finally I have (blocks/partials/view fragments) with CI. I feel like I close one more steps to my kind of CMS..

Good luck!

Profile
 
 
Posted: 31 May 2008 04:34 PM   [ Ignore ]   [ # 40 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  709
Joined  06-07-2007

can you load controllers from different applications?

 Signature 

jtaby.com

Profile
 
 
   
4 of 12
4