zend-controller-router

Language as subdomain with Zend 1.9

Hello, I am playing with Zend 1.9 and would like to have the language parameter as subdomain. Like : http://en.site.com Is it possible to get the language in .htaccess and set it to an environment variable which I can use in Zend ? What is the best way to achieve what I want ? -- added --: I added this into my routes.ini : [routes...

Zendframework Routing Issue

I have been setting my routes in my application.ini file which works for all the ones i have setup. The problem is when there are multiple actions within that controller and i try to use the routes in other actions. For instance i have created the following in my application.ini for paging and column sorting resources.router.routes.sea...

Zend_Controller_Router_Route_Hostname with additional variable

I'm having a problem with chaining some routes using another variable at the end. I'm using wild card sub domains. Like this: http://eric.mysite.dev/mypage1 mypage1 is going to be a GET variable. So what I want is http://mysite.dev/donate/now/index/id/eric/pagename/mypage1 I have it working fine without the pagename like this: $router=...

Tips on writing/designing a URL Router in PHP using OOP

I love the elegance of Zend_Controller_Router_Rewrite and the various route classes it uses. I'd like to write a very similar routing system as a standalone component so I can translate URLs into a set of parameters and assemble them back again. The idea is to use them to select, say, an URL normalization handler on a per-path basis. ...

Zend_Controller_Router: Get language from translated segment

I want to use a URL rewrite on my site: /:@controller/:@action/ So I want to use translated segments on route and I want to detect requested language from these translated segments. For example, if user request a url like this: /user/profile/ then I could understand that requested language is English. And if user request a url like...

How do I write chains of chains of ... of route in a ini file for the Zend framework?

I am trying to define routes as below with an INI file for the Zend Framework: http://api.example.com/servicename/{version}/users/:userid/items/:itemid routes.host.type = "Zend_Controller_Router_Route_Hostname" routes.host.route = "api.example.com" routes.host.chains.api.type = "Zend_Controller_Router_Route_Static" routes.host.chains.a...

Using Zend_Controller_Router_Route to create friendly URLs for the actions in IndexController

In my IndexController, I currently have indexAction (homepage), loginAction and logoutAction. I'm trying to remove "/index/" from the URL to get domain.com/login instead of domain.com/index/login. What is the cleanest way to achieve this? Is there a RegEx we can use? I don't ever want /index/ in the URL. My current solution, which I...

Zend Router various URLs

I would like to achieve something like this with ZF router. ('controller' => 'products', 'action' => 'index') //Show product details 'http://mydomain.com/en/products/category-1/subcategory-3/product-name.htm' //List products in subcategory-3 'http://mydomain.com/en/products/category-1/subcategory-3.htm' //List products in category-...

Zend_Controller_Router_Route: Could not find a translator

I am developing a multilanguage application. In the bootstrap there is the routes setup: protected function _initRoutes() { $this->bootstrap('frontController'); $router = $this->frontController->getRouter(); // PAGES ROUTE $page = new Zend_Controller_Router_Route( ':language/:ident', array( ...

Optional param Zend Route Regex

Hello, How to make route regex parameters optionals with Zend ? I try to make well formatted URLs ("search?s=mp&t=w" instead of "search/index/s/mp/t/w") for search filters, ex. : Popularity Most popular (s=mp) Most viewed (s=mv, default) Top rated (s=tr) Most commented (s=mc) Period All period (t=a, default) Today...

How do I structure Zend_Controller_Router_Route to handle the action and a param key in the same position?

Here is my route in JSON: "jobs": { "type":"Zend_Controller_Router_Route", "route":"/jobs/:action/:id/*", "defaults": { "module":"api", "controller":"jobs", "action":"index", "id":0 } } This allows for URIs like the following and works perfectly well so far: /jobs/ -> action=index, id=0 /jobs/v...

Zend Framework - Set No Layout for Controller

I have a Controller that I want to use for ajax scripts to call and set session variables, get information, etc. How do I set it so that that particular controller doesn't use the default layout (specifically NO layout) so that it can send XML/JSON messages back and forth? I have an inkling I should use a custom route but I do not know m...

ZF: Custom route, make all parts as param

Hi All, Hopefully someone can help me out here. I have a Zend Router that handles adding stuff to the basket. Now i'm building a customiser module, so the user can add as many parts, in different colors, on specified sections of the product. My basic url is like this http://www.domain.com/shop/add/custom/size/type My current router...

Zend Framework isn't looking for camel cased actions when using the router

Hi guys im having a spot of bother, hope someone can shed some light on this. For some strange reason my route comes up saying action does not exist unless i change the camel casing to all lower case for that actions name then it works fine. but then that goes against the naming conventions! and i dont want to make my code sloppy either...

Zend Router (How to direct url such as /administration/users to Administration_UsersController)

I would like to keep the old default Zend Router, and just add a router for administration subpages since the controllers are growing in size and I would like to logically separate them a little as well as have cleaner URLs. The documentation seems to explain how to do other things but not this... ...

Zend_Router omitting param-key

Hey guys, I've got a question considering Zend_Controller_Router. I'm using a a modular-structure in my application. The application is built upon Zend-Framework. The normal Routes are like this: /modulename/actionname/ Since I always use an IndexController within my modules, it's not necessary to provide it in the url. Now I am able ...