EllisLab text mark
Advanced Search
1 of 8
1
   
Wick 0.91 - Discontinued
Posted: 22 May 2008 08:37 PM
Avatar
Joined: 2006-06-16
319 posts

Discontinued
My Wick project is discontinued. Wick is a simple library that provides a method for loading and rendering one controller from within another controller. If anyone wishes to, they’re welcome to grab my code and continue work on it. But I wont be supporting or updating this project any longer. Best regards.

The library can be downloaded here.

 Signature 

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

 
Posted: 22 May 2008 09:07 PM   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2007-06-10
2937 posts

Interesting use of EVAL Zach.

Is this PHP4 compatible?

 Signature 

URI Language Identifier | Modular Extensions - HMVC | View Object | Widget plugin | Access Control library

 
Posted: 22 May 2008 09:11 PM   [ # 2 ]   [ Rating: 0 ]
Avatar
Joined: 2006-06-16
319 posts

Yeah, it’s not the most elegant of hacks, but it works. smile

Regarding PHP4 support, I can’t say for sure, since I recently reinstalled XAMPP and took the lite version (which only comes with PHP5). I’m almost certain it is compatible, though.

 Signature 

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

 
Posted: 22 May 2008 09:21 PM   [ # 3 ]   [ Rating: 0 ]
Avatar
Joined: 2007-06-10
2937 posts

The reason I ask is because in PHP4, the Controller extends CI_Loader (via CI_Base) and Wick also has a controller function which may clash with the main Controller constructor.

Hope this helps.

Just a note also that Modular Extensions 4.1 uses CI Controllers in modules, and it is possible to load or run one controller from another, and modules are accessible from the URL now.

 Signature 

URI Language Identifier | Modular Extensions - HMVC | View Object | Widget plugin | Access Control library

 
Posted: 22 May 2008 09:23 PM   [ # 4 ]   [ Rating: 0 ]
Avatar
Joined: 2006-06-16
319 posts

Neat, thanks for the heads-up. This will require a bit of testing then.

 Signature 

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

 
Posted: 23 May 2008 10:50 AM   [ # 5 ]   [ Rating: 0 ]
Avatar
Joined: 2006-06-16
319 posts

Alright, I can confirm that it is, indeed, PHP4 compatible.

I am aware that Modular Extensions allows this functionality, but I needed a method for doing this without the use of modules, in which case ME might be overkill. smile

 Signature 

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

 
Posted: 23 May 2008 03:48 PM   [ # 6 ]   [ Rating: 0 ]
Avatar
Joined: 2006-08-06
918 posts

wick = wicked cool code. keeping an eye on this thread (as i have been with ME thread which is now over 40 pages long!).

 Signature 

peeker email (imap/pop) | site_migrate | OOCalendar | PhotoBox2 | word_limiter

 
Posted: 23 May 2008 05:32 PM   [ # 7 ]   [ Rating: 0 ]
Avatar
Joined: 2008-01-07
2509 posts

Although I’m usually in the pitchfork camp, I must say that is some very clever code.

 Signature 
 
Posted: 23 May 2008 06:52 PM   [ # 8 ]   [ Rating: 0 ]
Joined: 2006-10-17
207 posts

Nicely coded. Cool approach by extending the loader class and replace $this->load.

 
Posted: 24 May 2008 04:25 PM   [ # 9 ]   [ Rating: 0 ]
Avatar
Joined: 2006-06-16
319 posts

Thanks. smile

I had been thinking a bit about the problems with multiple libraries extending the same library, and this is the cleanest approach I could come up with.

 Signature 

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

 
Posted: 25 May 2008 11:47 PM   [ # 10 ]   [ Rating: 0 ]
Joined: 2007-08-23
81 posts

Hey Zacharias,

Wow, I like this idea a lot, especially the fact that it accepts segments as a parameter! This way it allows you to use the same controller standalone or as part of another page using the same set of segments, which really makes sense from a site-structuring point of view.

Will it be compatible with Matchbox at some point? That would be great!

Thanx!

 
Posted: 26 May 2008 08:45 AM   [ # 11 ]   [ Rating: 0 ]
Avatar
Joined: 2006-06-16
319 posts

Yes, I actually took a quick look at using Wick with Matchbox yesterday, and it only takes a single line of code to make it work. Untill I release the next version of Matchbox (might take a while, I’m pretty busy with school, and most of the examns are next week) you can add this line to the Router.php file:

...

function 
_validate_request($segments)
{
    
// {{{ Matchbox
    
$this->_called 0// <-- Insert this line (at line 239)

    
foreach($this->_matchbox->directory_array() as $directory{

... 

That should do the trick. Please let me know if it works.

 Signature 

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

 
Posted: 26 May 2008 09:09 AM   [ # 12 ]   [ Rating: 0 ]
Joined: 2007-08-23
81 posts

Works like a charm! Thanx a lot!

 
Posted: 26 May 2008 09:22 AM   [ # 13 ]   [ Rating: 0 ]
Joined: 2007-08-23
81 posts

Short silly question: how can I pass variables from one controller to another? To my understanding I would add them like this (url-style):

$this->load->controller('contoller/method/var1/var2'); 

But looking at the code, this doesn’t seem to be the case wink Should I use an array to do this?

 
Posted: 26 May 2008 10:56 AM   [ # 14 ]   [ Rating: 0 ]
Avatar
Joined: 2006-06-16
319 posts

Have you tried your idea that is adding them like segments? It might just work.

 Signature 

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

 
Posted: 26 May 2008 11:06 AM   [ # 15 ]   [ Rating: 0 ]
Joined: 2007-08-23
81 posts

I tried that, but can’t get it to work. Are you saying it SHOULD work or it COULD work? wink

 
1 of 8
1