Page 1 of 1

Zend URL

Posted: Thu Feb 21, 2008 6:30 pm
by Scrumpy.Gums
Hi,
I'm giving Zend another try and have come across a slight hitch :( I want the URL to be http://localhost/event/title/a-title, using EventController.php. The problem is that it tries to interpret title as an action, but I want it to use it as a $_GET parameter.

It works fine if I use an IndexController.php with an eventAction i.e. the URL is:
http://localhost/index/event/title/a-title. But I'd like to get rid of the index part. :?

The other situation it works is using the URL http://localhost/event?title=a-title. I've tried using a RewriteRule in the main .htaccess but that doesn't seem to work. The Rule I used was:
RewriteRule ^event/title/(.*)$ /event?title=$1

Any suggestions as to how I could accomplish this? :|

Re: Zend URL

Posted: Thu Feb 21, 2008 6:36 pm
by Christopher
In "/event/title/a-title" and "/index/event/title/a-title", what is the module, controller, action and params?

Re: Zend URL

Posted: Fri Feb 22, 2008 3:20 am
by Scrumpy.Gums
In "event/title/a-title":
Controller: event
Action: index
Param: title

In "index/event/title/a-title":
Controller: index
Action: event
Param: title

Not sure what the module is :oops:

With the first one, it's doing the logical thing i.e. Controller/Action/Param, but I want it to do something less logical :dubious: ... I want it to use index as the action, not title. Is there any way to do that without having to use "event/index/title/a-title"? Hope that makes sense.. :|

many thanks.

Re: Zend URL

Posted: Fri Feb 22, 2008 3:53 am
by Christopher
Scrumpy.Gums wrote:I want it to use index as the action, not title. Is there any way to do that without having to use "event/index/title/a-title"?
Yes, you need to define routes for those that are different. Check to documentation for the Front Controller and Router.

Re: Zend URL

Posted: Fri Feb 22, 2008 7:30 am
by Scrumpy.Gums
great, I'll look into that. :wink: