Questions tagged [zend-controller-router]

Standard router component in Zend Framework. Zend Framework is an open source, object-oriented web application framework implemented in PHP 5 and licensed under the New BSD License.

zend-controller-router is a tag suitable for questions regarding standard router component in Zend Framework.

56 questions
1
vote
2 answers

Add a prefix for the default route of Zend_Controller_Router_Route_Module

I would like to know if it is possible to change the default route of :module/:controller/:action/* to something like /my/prefix/:module/:controller/:action/*, keeping the possibility to not specify a module and/or controller and/or action.
Cristiano Santos
  • 2,157
  • 2
  • 35
  • 53
1
vote
1 answer

Set multiple router for same controller in zend framework

How to set multiple router for the same controller,if we are facing with the different action in one controller? I have two action in my controller services in admin module. First action is manage and second is manageArticle Here is my…
Swapnil T
  • 557
  • 7
  • 17
1
vote
0 answers

Zend Rest Route: goto the right method (get/put/post/delete)

I am retiring a custom PHP project that was used as an API. I need to support such URLS such as /post/{id}/copy.json (copy post with {id} /post (all posts) /post/{id} (return one post) So far its going okay, however routing I'm finding difficult. I…
azz0r
  • 3,283
  • 7
  • 42
  • 85
1
vote
2 answers

Add router modules in Zend

I have this code: $defaultAdmin = array ('module' => 'admin', 'controller' => 'index', 'action' => 'index' ); $routeAdmin = new Zend_Controller_Router_Route ( 'admin/:controller/:action/*', $defaultAdmin ); $router->addRoute ( 'admin', $routeAdmin…
Cito
  • 1,659
  • 3
  • 22
  • 49
0
votes
2 answers

Zend - routing rules based on parameters number

in my project I'm using zend to handle routing. Atm we've got routing rules which looks like this: array( 'match' => 'page', 'params' => array('page', 'idConfiguration'), 'controller' => 'controler1', 'action'…
0
votes
1 answer

Zend translate URL and language switcher

I have managed to make my URL i18n compliant using Zend_Controller_Router. Ie: en/user/login becomes fr/utilisateur/connexion and both URLs go to the same controller/action. The problem I am facing is the following I have a language switcher that is…
JF Dion
  • 4,014
  • 2
  • 24
  • 34
0
votes
1 answer

Invalid controller specified (adminlogin)

Code for indexAction() in AdminLoginController is: $form_object = new Application_Form_NewProfile(); $form_object->setAction('/adminlogin/index'); $form_object->setMethod('post'); $this->view->form =…
ryan
  • 333
  • 1
  • 15
  • 28
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

Seo friendly urls with the Zend Router

I want to create seo friendly urls in my Zend Framework application but how is the correct syntax for this: $newsroute = new Zend_Controller_Router_Route( 'news/:action/:id_:title', array( 'controller' => 'news' )); :id_:title obviously…
Johni
  • 2,933
  • 4
  • 28
  • 47
0
votes
2 answers

Zend Framework hostname route with subdir

A module of my project should have it's own domain so i created a route for it: $portalurl = str_replace( 'http://', '', $config->domains->portal ); $hostnameRoute = new Zend_Controller_Router_Route_Hostname( $portalurl, array( 'module' =>…
Johni
  • 2,933
  • 4
  • 28
  • 47
0
votes
1 answer

ZF: wrong links when using routing in bootstrap

The problem is when generating Zend_Navigation menu in the view all links have "/projects/add/" href. At the same time when "/projects/list/" is active all links are correct. The same if I deleted this route - all links are ok. So, while…
0
votes
1 answer

How to rewrite this route to ini format?

I have the following PHP code: $hostnameRoute = new Zend_Controller_Router_Route_Hostname( 'subdomain.example.com', array( 'module' => 'subdomain', 'controller' => 'index', …
Derk
  • 243
  • 1
  • 3
  • 11
0
votes
2 answers

Zend Framework product catalog routes

I need some help to build routes for my product catalog. I whant to have urls something like this: /products/electronics/14 /products/electronics/computers /products/electronics/computers/laptops/4 Last numbers in urls shows current listing page…
Irmantas
  • 3,331
  • 2
  • 18
  • 10
0
votes
1 answer

Zend_Router omitting param-key

I've got a question considering Zend_Controller_Router. I'm using a a modular-structure in my application. The application is built upon Zend-Framework. The normal Routes are like this: /modulename/actionname/ Since I always use an IndexController…
Fidi
  • 5,754
  • 1
  • 18
  • 25
0
votes
2 answers

Zend_Controller_Router: Get language from translated segment

I want to use a URL rewrite on my site: /:@controller/:@action/ So I want to use translated segments on route and I want to detect requested language from these translated segments. For example, if user request a url like this: /user/profile/ then…