Zend_Controller in sub directory

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Zend_Controller in sub directory

Nayana Hettiarachchi - GMI

Hi,

 

Maybe this question was raised before I apologize if so for creating a duplicate message.

 

Today I gave my first shot trying to play around with the Zend_Controller, and I quickly learnt that it tokenizes the REQUEST_URI string prior to dispatching.

 

Hence this I am not sure if it’s possible to implement a controller at a sub level directory. I can see an easy hack on the Router.php to wipe out my static path prior to tokenizing it. Will this be sufficient? Did anyone here implemented controller in a sub level with a different strategy, if so please do share your thoughts.

 

I also see in the router that if a ? is passed then all values after the “?” is erased

$path = $_SERVER['REQUEST_URI'];

        if (strstr($path, '?')) {

            $path = substr($path, 0, strpos($path, '?'));

        }

 

If the only change required is re-setting the REQUEST_URI will you guys be adding a feature to Router::IgnorePath(); so this can be done with out hacking the file.

 

Thank in advance

 

Regards,

Nayana

 

 

 

 


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Zend_Controller in sub directory

akrabat
Nayana Hettiarachchi wrote:

> Hence this I am not sure if it’s possible to implement a controller at a
> sub level directory. I can see an easy hack on the Router.php to wipe
> out my static path prior to tokenizing it. Will this be sufficient? Did
> anyone here implemented controller in a sub level with a different
> strategy, if so please do share your thoughts.


It's come up a few times :) You have to override the current router to
solve the problem for now. See
http://www.akrabat.com/2006/03/15/zend-framework-router-again/ for my
ideas on it.

There is new routing code in the incubator that should solve this
problem. With any luck the next release should include it!


Regards,

Rob...