Questions tagged [zend-route]

Routing in Zend Framework's MVC implementation. Zend Framework is an open source, object-oriented web application framework implemented in PHP 5 and licensed under the New BSD License.

zend-route is a tag suitable for any questions regarding routing in Zend Framework's MVC implementation, url handling, or any other matter affecting or affected by routing in Zend Framework.

319 questions
98
votes
5 answers

How to access route, post, get etc. parameters in Zend Framework 2

How can I get various parameters related to the page request in zf2? Like post/get parameters, the route being accessed, headers sent and files uploaded.
Matsemann
  • 21,083
  • 19
  • 56
  • 89
26
votes
1 answer

What is 'may_terminate' in zend framework 2?

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…
Geek
  • 8,280
  • 17
  • 73
  • 137
25
votes
1 answer

Translate url parameters as place holder

I wondering how to translate a URL in ZF2 that has a parameter on it. For example: /{:language_link-schools-:city_link} The reason why I don't do: /:language_link-{schools}-:city_link It is because in some languages, for example, Spanish, the…
peterpeterson
  • 1,315
  • 2
  • 14
  • 38
14
votes
2 answers

Working with prefixes and Zend_Controller_Router_Route

On an existing Zend Framework website with few controllers and no modules I need to add some prefixes to the default routes. For example, I currently have : /products /products/id/1 /training /commonpage I want to add a product line level, without…
vard
  • 4,057
  • 2
  • 26
  • 46
12
votes
6 answers

Set url parameter in redirect in zend framework v2

I have following redirect script in my controller (Zend Framework 2) return $this->redirect()->toRoute('default', array( 'controller' => 'admin', 'action' => 'index' )); Currently redirecting to…
Sina Miandashti
  • 2,087
  • 1
  • 26
  • 40
10
votes
4 answers

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…
Richard Parnaby-King
  • 14,703
  • 11
  • 69
  • 129
9
votes
7 answers

How to set controller/action to Page Not Found

I have a controller and action which I'm accessing through a custom URL. The original route is still accessible though at the default location zend.com/controller/action How can I change this to simulate a "Page not found" when the user tries to…
jblue
  • 4,390
  • 4
  • 46
  • 79
9
votes
3 answers

Zend Framework - setting up user-friendly URLs with routes and regex

I have two issues with user-friendly URLs. I have a router set up as follows: The actual URL is http://www.example.com/course/view-batch/course_id/19 I want a friendlier URL http://www.example.com/java-training/19 I have setup the following route…
Gublooo
  • 2,550
  • 8
  • 54
  • 91
9
votes
2 answers

Zend_Translate - Zend_Navigation and Routing combination problem!

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…
9
votes
3 answers

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…
8
votes
2 answers

Matching Multiple URLs with parameters using Zend_Controller_Router_Route_Regex in Zend Framework

i am developing a Rest Controller with Zend and i am confused with the mapping of urls to the Router. Basically i read about Zend Router and i could not plan my urls in order to satisfy the mentioned routes. These are some of my urls that should be…
shasi kanth
  • 6,987
  • 24
  • 106
  • 158
6
votes
2 answers

Zend_Controller_Router_Exception: Route default is not defined

I'm trying to test a controller. Zend Tool has generated the following code: class Default_CarrinhoControllerTest extends Zend_Test_PHPUnit_ControllerTestCase { public function setUp() { $this->bootstrap = new Zend_Application(APPLICATION_ENV,…
dextervip
  • 4,999
  • 16
  • 65
  • 93
6
votes
3 answers

Zend Framework route: unknown number of params

I'm trying to write a route for an level N category depth. So an usual category URL would look like this: http://website/my-category/my-subcategory/my-subcategory-level3/my-subcategory-level4 It has an unknown depth and my route has to match all…
Bogdan Constantinescu
  • 5,296
  • 4
  • 39
  • 50
6
votes
2 answers

ZF2 optional route constraints in child routes

I'm having an issue with an optional constraint in a route that is non-optional in it's children. My routing structure is as follows: 'profile' => [ 'type' => 'segment', 'options' => [ 'route' => '/profile[/:id]', …
Ross
  • 46,186
  • 39
  • 120
  • 173
6
votes
1 answer

How to add variable at the start of the URL in Zend Framework?

I am trying here to create url, like: /admin/login /moderator/login both the request would be served by same controller & action made for login, i.e. /account/login/ Currently, all I am able to make the following…
s_s_
  • 463
  • 5
  • 20
1
2 3
21 22