ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Wick 0.91 - Discontinued

May 22, 2008 8:37pm

Subscribe [31]
  • #1 / May 22, 2008 8:37pm

    zdknudsen's avatar

    zdknudsen

    305 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.

  • #2 / May 22, 2008 9:07pm

    wiredesignz's avatar

    wiredesignz

    2882 posts

    Interesting use of EVAL Zach.

    Is this PHP4 compatible?

  • #3 / May 22, 2008 9:11pm

    zdknudsen's avatar

    zdknudsen

    305 posts

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

    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.

  • #4 / May 22, 2008 9:21pm

    wiredesignz's avatar

    wiredesignz

    2882 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.

  • #5 / May 22, 2008 9:23pm

    zdknudsen's avatar

    zdknudsen

    305 posts

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

  • #6 / May 23, 2008 10:50am

    zdknudsen's avatar

    zdknudsen

    305 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. 😊

  • #7 / May 23, 2008 3:48pm

    sophistry's avatar

    sophistry

    906 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!).

  • #8 / May 23, 2008 5:32pm

    Pascal Kriete's avatar

    Pascal Kriete

    2589 posts

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

  • #9 / May 23, 2008 6:52pm

    nmweb

    206 posts

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

  • #10 / May 24, 2008 4:25pm

    zdknudsen's avatar

    zdknudsen

    305 posts

    Thanks. 😊

    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.

  • #11 / May 25, 2008 11:47pm

    gerben

    75 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!

  • #12 / May 26, 2008 8:45am

    zdknudsen's avatar

    zdknudsen

    305 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.

  • #13 / May 26, 2008 9:09am

    gerben

    75 posts

    Works like a charm! Thanx a lot!

  • #14 / May 26, 2008 9:22am

    gerben

    75 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 😉 Should I use an array to do this?

  • #15 / May 26, 2008 10:56am

    zdknudsen's avatar

    zdknudsen

    305 posts

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

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases