Questions tagged [zend-router]

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

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

78 questions
1
vote
1 answer

ZF2 segment child route not working

What im trying to achieve: domain.com/user = UserController::index domain.com/user/profile = UserController::profile domain.com/user/profile/9 = UserController::profile (with query param…
YRM
  • 301
  • 4
  • 13
1
vote
1 answer

Zend get route from controller

Is it possible from a controller to get the routes to all other controllers? What I need is to fetch the "/customer/:customer_id/" path. I have scanned the controller folder so I know the names of all my controllers. Any suggestions?
Gabriel
  • 464
  • 1
  • 5
  • 17
1
vote
1 answer

ZF1 Zend_Controller_Router_Route optional segments

I have some issues with Zend_Controller_Router_Route. I have the following url in standard module/controller/action notation: http://www.mysite.com/rent/index/region/myregion/town/mytown/district/mydistrict/filter_params/filter_values module:…
Jesse
  • 4,323
  • 3
  • 17
  • 16
1
vote
1 answer

Inject default value in ZF2 Router

I currently have a Segment route looking like this: /shop/:shopId/ where shopId has no default value. Whenever the route is matched a code in Module.php is triggered, that would do some preparation according to the shopId and save it in the session…
Tony Bogdanov
  • 7,436
  • 10
  • 49
  • 80
1
vote
1 answer

Zend Framework 2 - custom router (from mysql)

I have a question about zend framework 2 router. I have a table "seourl" in mysql like that: url module controller action param test123 catalog product view 5 abc123 …
user1744166
1
vote
1 answer

Creating URL for pagination, ordering and filters - ZF

I everyone who's reading this, I was on the Internet 5 minutes ago and I found a URL that was pretty nice: www.exemple.com/blog/rating.asc/2 Which is related to: blog => controller/action/module or anything rating => ordered by asc => order of…
Frederick Marcoux
  • 2,195
  • 1
  • 26
  • 57
1
vote
1 answer

While using Zend Router, other links (the ones that aren't defined as routes) corrupt

I am using Zend Framework 1.12. I wanted to add some routers. There are users and administrators in my system, and I have added a router for administrator viewing user's page. I added // meant to create the usage "xxx.com/userview/someusername" …
1
vote
1 answer

ZendFramework 2 - how can i do the similar Bootstrap.php like in ZF1?

I have ZF 1 where i got working Bootstrap.php with lots of routing and other preDispatch stuff. But in ZF2 there is no Bootstrap.php concept anymore? Or i mean how can i do this same in Zf2?
user285594
1
vote
0 answers

Zend Custom Route if no match found

I have a ZF app with several modules as this: ( as usual ) root\ \application\ \default \items \me \controllers \views The application uses the default…
0
votes
2 answers

Zend adding parameter to URL before generating view

The title might be misleading but I'm trying to do something very simple but cant figure it out. Lets say I have a Question controller and show action and question id is the primary key with which I look up question details - so the URL looks like…
Gublooo
  • 2,550
  • 8
  • 54
  • 91
0
votes
1 answer

Zend Implementing SEO friendly or vanity URLs with router

I have a simple e-commerce web application with product URL's like: http://www.example.com/product/view/product_id/15 where "Product" is the controller and "view" is the action in the Product Controller How do I change this URL to show up…
Gublooo
  • 2,550
  • 8
  • 54
  • 91
0
votes
2 answers

Zend Created route and now all links use this url

I created a route to view users profiles: $router = Zend_Controller_Front::getInstance()->getRouter(); $route = new Zend_Controller_Router_Route( 'profile/:username', array( 'username' =>…
somejkuser
  • 8,856
  • 20
  • 64
  • 130
0
votes
1 answer

Zend url rewrite BASE_URL/en to BASE_URL?lang=en

I have already spent many hours on this and I think I could use some help. So I have a local zend project available at http://MY_URL.lh. I have this htaccess file: RewriteEngine On RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond…
0
votes
1 answer

How to use Zend_Config with the RewriteRouter?

I have the following URL: "http://localhost/mysite/blog/article/index/id/1" module => blog controller => article action => index and i want to structure my url like so: "http://localhost/mysite/blog/article/1" to set the default 'action' as 'index'…
Markel Mairs
  • 742
  • 2
  • 10
  • 28
0
votes
2 answers

Zend Framework - Route: Call action by param

$router->addRoute('routeName', new Zend_Controller_Router_Route( 'test/:category/', array( 'module' => 'default', 'controller' => 'test', 'action' => ':category' ) )); That's my code at the moment (see…
Poru
  • 8,254
  • 22
  • 65
  • 89