zend-route

Zend Routes conflict

I have defined 2 custom routes. One for threads/:id/:name and the other for threads/tags/:tagName however the second one conflicts with the first because if I enable both then the first breaks and treats :id literally as an action, not obeying the \d+ requirement ( I also tried using pure regex routes, see bottom ). Action "1" does n...

Zend Framework routes with Zend_Config_XML

Hello, I need to convert my existing routes.ini file to an XML file (my host disabled parse_ini of PHP). Anyway, I couldn't find proper examples so I tried my luck using the conventional Zend_Config_XML structure. See below: <?xml version="1.0"?> <configdata> <routes> <Home route=":locale/"> <defaults controller="index" action="i...

How to set up Hierarchical Zend Rest Routes?

With the Zend Framework, I am trying to build routes for a REST api on resources organized in the following pattern: http://example.org/users/ http://example.org/users/234 http://example.org/users/234/items http://example.org/users/234/items/34 How do I set up this with Zend_Rest_Route? Here is how I have setup the route for the use...

Zend Hostname Routeur and url helper : losing port

Hi, I would like to keep my port number which is different on production and development environment, but calls to the url helper based on my zend routes forget the port number. My routes are a bunch of regexp routes, chaining with default hostname routes, mainly for multilanguage over a multidomain configuration (short overview below...

Zend_Translate - Zend_Navigation and Routing combination problem!

Hello there, I'm having some difficulties with the combination of Zend_Navigation, Zend_Translate and the routing needed. My site navigation is done through Zend_Navigation based on and XML file. I've now added translation to the site based on Zend_Translate and added to following change of routing to the bootstrap: protected function...

Routing based on standard PHP query string

As you know, Zend Framework (v1.10) uses routing based on slash separated params, ex. [server]/controllerName/actionName/param1/value1/param2/value2/ Queston is: How to force Zend Framework, to retrive action and controller name using standard PHP query string, in this case: [server]?controller=controllerName&action=actionName&param...

I want to build a custom router for Zend framework supports lang & country

Here is an example of what i want to do The Url will be as follow http://www.example.com/en/us/directory/companies/view/4433225.html Where is en: is the lang us: is the country directory: is the module companies: is the controller view: is the action 4433225.html: is sort of parameter send to the action could be the company name like th...

Zend Framework cleaning default routes when adding other

I have the following problem with Zend Framework. My project has several controllers like Video,Category and Post. The VideoController has an Action called categorylist, so the default URL/Route becomes /video/categorylist Since the action requires 3 parameters I whant to add one simple route: $router->addRoute( 'categorylist...

Problem in implementing the Url Rewritting for a Zend Application

Hello everyone, I am doing my first Zend Applicaition and I am finally done with the coding side. But the problem which I have is Client has asked to rewrite the Url's which follows the SEO and as I don't have much knowledge of the Zend Router,I am finding myself helpless this time. Please helo me out.The current Url which I have is... ...

Zend Router Route Regex with Search params

Hi , Trying to grab the params after ?. I need them to add to the Zend_Paginator. ex: http://www.example.com/test/show?name=xxx&amp;age=20&amp;sex=m Building a paginator for search results. Is there any solution for that ? $router = new Zend_Controller_Router_Route_Regex( 'test/show\?(.*)', array( ...

How to avoid index.php in Zend Framework?

I'm using the Zend Router and so things like (/ and /index.php) or (/about and /index.php/about) ends up as the same here. However, /index.php/whatever should not exist as it is the exactly same resource as /whatever so it doesn't make a sense the duplication. How do I avoid this? Even http://zendframework.com/manual/en/zend.controlle...

Default route is matched instead specific route

<routes> <www type="Zend_Controller_Router_Route_Hostname"> <route>www.domain.com</route> <chains> <index type="Zend_Controller_Router_Route"> <route></route> <defaults module="default" controller="index" action="index" /> </index> <community> ...

Zend Routing:: How I can send all request that going to application-> IndexController to application->module->store->IndexController

Hi, How I can send all request in zend project to my default module controller (without use .access files). Now it going to application->IndexController, Instead I need that every request will go to application->module->store->IndexController. I try this: public function indexAction() { $this->_forward('index','index','store')...

url to http request object

I need to convert string like this: $url = 'module/controller/action/param1/param1value/paramX/paramXvalue'; to url regarding current router (including translation and so on). Usually I generate the target urls using url view helper, but for this I need to specify all params, so I would need to manually explode the string. I tried to...

Zend_Controller_Router_Route_Regex reverse route not translated

This is how my route looks like: acc_long.type = Zend_Controller_Router_Route_Regex acc_long.route = "@accommodation/([A-Za-z-]+)/([0-9A-Za-z-]+)-([0-9]+)" acc_long.map.1 = 'location' acc_long.map.2 = 'name' acc_long.map.3 = 'id' acc_long.defaults.controller = "accommodation" acc_long.defaults.action = "index" acc_long.default...

Zend Form SetAction Using Named Routes

I have a form that I am trying to set the action for. I want to declare the action inside my form file (which extends Zend_Form) instead of in a controller or view, using a route I have created in my bootstrap. Usually when I want to use a route I do something like $this->url(array(), 'route-name'); in the view, or $this->_helper->ur...

Zend Framework - Where to put the robots.txt file?

Zend framework i have directory tree as following with robots.txt file, but when i browse www.site.com/robots.txt , it says page not found error. How do i tell ZF that robots.txt is allowed? A. Directory tree: wwwsite/application wwwsite/library wwwsite/ZendFramework-1.10.7.tar.gz wwwsite/public . |--- captcha | |--- css |--- js |---...

ZF: Route to partner website URL

Hi, How can i setup a route that points to URL of a partner website? Example: <a href="<?php echo $this->url(array(), 'superPartnerRoute'); ?>">Try this ultra fab partner website</a> Reason for this; the URL is quite complicated and used around the website i'm working on. http://slippery.slick.domain.com/very/long/url/index.asp?vie...

Zend Navigation and Zend Router problem - not finding correct active page

Okay. I'm building a CMS with Zend. It isn't as simple as it looked but still — the best solution for me. I have a tree system with ID and PARENT, PARENT marks under which page the child resides. Anyway. Simple stuff. Every time a page is created or sorted Nav & Routes are regenerated. I'll copy the whole Admin_Pages_Model code for cre...

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