zend-router

Route mit special characters are not parsed correctly in Zend Framework 2

假装没事ソ 提交于 2019-12-29 01:24:09
问题 URIs with german special characters don't work (error 404). I've already had this problem (here) and it has been resolved with the unicode modifier and a custom view helper, that uses it. Now I have the same issue with a Segment child route, but this time the approach with the unicode identifier and a custom view helper isn't working. Alle requests like sld.tld/sport/sportäöüÄÖÜß/cityäöüÄÖÜß or sld.tld/sport/sportäöüÄÖÜß/cityäöüÄÖÜß/page/123 are ending with a 404 error. /module/Catalog/config

ZF2 Routing as in ZF1

被刻印的时光 ゝ 提交于 2019-12-20 10:27:36
问题 How can I make the routing automatically work for everything in the ZF1 structure? module/controller/action/par1Name/par1Val/par2Name/par2Val/ I read the information about routing, but the way I see it, I'd have to add all actions manually, and I see a problem with optional params... 回答1: You can set up a wildcard child_route, at least on a per-controller basis, to get zf1-like routes: 'products' => array( 'type' => 'Zend\Mvc\Router\Http\Segment', 'options' => array( 'route' => '/products[/

double slash in URLs.

拥有回忆 提交于 2019-12-14 03:11:49
问题 Zend Route issue. Normally it works fine. http://www.example.com/course-details/1/Physics-Newtons-Law But if I type in an extra slash in the url, the noauthAction of my Error controller gets called. Example of URL's that are not working. http://www.example.com/course-details//1/Physics-Newtons-Law http://www.example.com/course-details/1//Physics-Newtons-Law Is there something I need to set in the route definition to allow extra slashes? Routing in application.ini resources.router.routes

Zend_Controller_Router_Route_Regex rewrite all my module links

Deadly 提交于 2019-12-13 05:13:29
问题 I'm using Zend_Framework 1. In my Bootstrap.php I rewrite my categories link something like that: $route = new Zend_Controller_Router_Route_Regex("^([a-z,0-9,-]*)(/|)([a-z,0-9,-]*)(/|)([a-z,0-9,-]*)(/|)([a-z,0-9,-]*)(/|)([a-z,0-9,-]*)(/date/|)([a-z]*)(/page/|)([0-9]*)$", array( "module" => "default", "controller" => "categories", "action" => "index" ), array( 1 => 'firstparam', 3 => 'secondparam', 5 => 'theeparam', 7 => 'fourparam', 9 => 'fiveparam', 11 => 'date', 13 => 'page', ) ); $router-

ZF2: How to get Zend\Navigation inside custom route?

廉价感情. 提交于 2019-12-11 01:41:32
问题 I have custom router and I have to get access to Zend\Navigation inside this custom router. I was googling, asking and searching and no results :/ All I need is to find nodes with 'link' param using Zend\Navigation in my Alias::match function. Here is my module.config.php: 'navigation' => array( 'default' => array( 'account' => array( 'label' => 'Account', 'route' => 'node', 'pages' => array( 'home' => array( 'label' => 'Dashboard', 'route' => 'node', 'params' => array( 'id' => '1', 'link' =>

Routing for country , province , city , product in Zend Framework

*爱你&永不变心* 提交于 2019-12-10 18:56:15
问题 This url structure is proposed for SEO optimization. So suggesting another structure will not work. Structure proposed is example.com/<language>/<country>/<province>/<city>/<product> example.com/en/spain I wish to point to CountryController indexAction , as view of each one is different, and sometimes think there is change in layout also. Show the content in English language about the country Spain. And for a request example.com/en/india should show about India in English language and example

How to get the dispatched route name in Zend framework?

故事扮演 提交于 2019-11-29 11:17:55
问题 Current state: A router is loaded from xml file two route name within the router are going to the same controller and action, for example: www-language-employee and www-language-trainer are going to the same controller and action --> EmployeeController & listemployeeAction Problem: - Need to know which route name is dispatched/being used from a request. Example: 1. http://www.mycompany.com/en/trainers/ Expected return value: www-language-trainer 回答1: Zend_Controller_Front::getInstance()-

What is 'may_terminate' in zend framework 2?

北战南征 提交于 2019-11-28 20:26:17
I am beginner working with Zend. I have seen may_terminate in module route configuration. I don't understand what it is for. According to ZF2 official docs , the option “may_terminate” hints to the router that no other segments will follow it. Still I don't get the meaning of no other segments will follow it . What is it here? Can anyone please explain it with small example? The may_terminate option will indicate to the router that 'this' route is able to be matched solely on the value of its route ; even when it defines child_routes . Consider the following example route configuration.

Route mit special characters are not parsed correctly in Zend Framework 2

删除回忆录丶 提交于 2019-11-28 12:57:55
URIs with german special characters don't work (error 404). I've already had this problem ( here ) and it has been resolved with the unicode modifier and a custom view helper , that uses it. Now I have the same issue with a Segment child route, but this time the approach with the unicode identifier and a custom view helper isn't working. Alle requests like sld.tld/sport/sportäöüÄÖÜß/cityäöüÄÖÜß or sld.tld/sport/sportäöüÄÖÜß/cityäöüÄÖÜß/page/123 are ending with a 404 error. /module/Catalog/config/module.config.php <?php return array( ... 'router' => array( 'routes' => array( 'catalog' => array(

What is 'may_terminate' in zend framework 2?

自古美人都是妖i 提交于 2019-11-27 13:04:49
问题 I am beginner working with Zend. I have seen may_terminate in module route configuration. I don't understand what it is for. According to ZF2 official docs, the option “may_terminate” hints to the router that no other segments will follow it. Still I don't get the meaning of no other segments will follow it . What is it here? Can anyone please explain it with small example? 回答1: The may_terminate option will indicate to the router that 'this' route is able to be matched solely on the value of