Questions tagged [zend-framework-routing]
56 questions
21
votes
3 answers
How can you add query parameters in the ZF2 / ZF3 url view helper
I'm attempting to create a url with a query string using a route, like so:
$this->url('users') -> /users
$this->url('users', ['sort' => 'desc']) -> /users?sort=desc
However this doesn't seem to work (the second helper actually outputs /users).…
Ross
- 43,016
- 36
- 114
- 168
8
votes
5 answers
ZF2: How to pass parameters to forward plugin which I can then get in the method I forward them to?
I have an Action method in Foo Controller which requires parameters:
public function fooAction($one, $two) {
$a = one;
$b = $two;
}
And I need to forward to that method from the other method of some Boo Controller. And one of those…
Green
- 21,978
- 45
- 138
- 223
4
votes
5 answers
Zend Framework 2 segment route required segment
I am trying to make a route (or two) that will let me invoke two different actions with the below URL formats.
mydomain.com/profile
mydomain.com/profile/1234/something
For the second format, the 1234 should be a required integer value, while…
ba0708
- 8,528
- 11
- 61
- 97
3
votes
1 answer
zf2 router: One module makes the router unable to find another module. How can I make both work?
We're just starting out with zf2, so someone else made a Thumbnail server module, and then I added a Lookup server module. I call these servers because they're both RESTful apis. Initially they seemed to work together, but someone made some changes…
mutatron
- 555
- 2
- 7
- 19
3
votes
1 answer
Routing View Sub Folders to controller in zend
Zend newbie here.
I have an admin folder in my View linked to an admin controller, but I need a sub folder(s) within the admin view to handle various functions.
For example: views/scripts/admin and I also want views/scripts/admin/linksfunction or…
user1887881
- 31
- 1
2
votes
1 answer
ZF2 Route based on method while extending AbstractRestfulController
In Zend Framework 2 I am trying to route a few dynamic urls to specified actions in a controller that extends AbstractRestfulController, based on the request type. Problem is, the AbstractRestfulController keeps overriding these routes to the…
shiznatix
- 1,007
- 18
- 35
2
votes
1 answer
URIs with german special characters don't work (error 404) in Zend Framework 2
I want to get a list of cities, where each city name is linked and refers a page for this city:
The links (created in the view script) look like this:
http://project.loc/catalog/Berlin (in the HTML source code url-encoded:…
automatix
- 10,950
- 17
- 85
- 198
2
votes
4 answers
ZF2: Controller's Forward plugin doesn't work. How to make it work?
I need to forward the ajax request to the other Action method of current controller. I use the Forward plugin but it doesn't work. There is an example in the manual about how to use the Forward Plugin:
$foo = $this->forward()->dispatch('foo',…
Green
- 21,978
- 45
- 138
- 223
2
votes
1 answer
Zend framework 2, pagination routing issue
I have issue on zend pagination and routing in zf2 . I would like to display details of feedback item , and list of its sub items ( actions ) on the same page . My route code is given below
$routes['dashboard_inbox_actions'] = array(
'type' …
rab
- 3,942
- 1
- 27
- 40
2
votes
3 answers
link to another action
i am unsing zend framework. i have a view linked to a controller, home,
so:
application>controllers>HomeController.php
application>views>scripts>home>index.phtml
in the index.phtml page i have a link to an action in the same…
RSM
- 12,215
- 34
- 89
- 138
2
votes
1 answer
Accessing Zend url action helper from a custom action helper in default module
So I normally have no problem using the "url" action helper from a custom action helper, when accessing a module, using the following:
$urlHelper = Zend_Controller_Action_HelperBroker::getExistingHelper('url');
But the following error occurs if the…
colordrops
- 83
- 7
1
vote
1 answer
ZF3: Action and view doesn't found
In my application I have created a second action in a controller. When I call the application with the url http://local.domain I've got the correct page so it's called the correct controller. But If I want to make this call…
José Carlos
- 2,170
- 7
- 43
- 78
1
vote
0 answers
Error action short circuiting application module bootstrap code
My error page never hits the following code during execution.
Understanding the DesignHandler is not important here but what is important is when an error occurs it routes correctly to the error page but never hits this piece of code.
namespace…
somejkuser
- 8,273
- 18
- 51
- 111
1
vote
1 answer
How to strip unused parameters from the url?
I'm using Zend Framework and the URL View Helper to create URLs
I have some lines like this in my navigation:
$this->url(array('controller' => 'index', 'action' => 'index'))
$this->url(array('controller' => 'who', 'action' => 'view', 'id' =>…
Rodrigo Souza
- 6,680
- 10
- 39
- 71
1
vote
1 answer
ZF2 Create route like " login?url=foo "
I'm struggling on this for 2 hours now. I've managed to create a route with parameter (named url) like /login/url:
'login' => array(
'type' => 'segment',
'options' => array(
'route' => '/login[/:url]',
'defaults' =>…
DavidL
- 1,081
- 1
- 15
- 28