zend-route

Zend_Controller_Router_Exception: Route default is not defined

丶灬走出姿态 提交于 2019-12-12 10:54:05
问题 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, APPLICATION_PATH . '/configs/application.ini'); parent::setUp(); } public function testIndexAction() { $params = array('action' => 'index', 'controller' => 'Carrinho', 'module' => 'default'); $urlParams = $this->urlizeOptions($params); $url = $this->url

Zend Routes translate URL's

坚强是说给别人听的谎言 提交于 2019-12-12 09:09:29
问题 1) I have a controller "calendar" and have action "showDate" which gets date via url. So, url is something like "calendar/show-date/date/2012-07-22" 2) I have a link to display all entries, "calendar/" So, I want to create routes so my links look like "kalendar/2012-07-22" and "kalendar/". Can anyone help me? 回答1: According to this post: http://www.z-f.fr/forum/viewtopic.php?id=5138 The solution is to add '@locale' => $lang to the params. $this->url(array('lang'=>'it','@locale'=>'it')) It

ZF2 Routing by Hostname works with other modules

∥☆過路亽.° 提交于 2019-12-12 01:28:53
问题 I added a reseller subdomain on my myhost.com ( reseller.myhost.com ) and I use it for routing to my Reseller module. Read this question I posted before here: click here My Reseller route config looks this: 'router' => array( 'routes' => array( 'Reseller' => array( 'type' => 'Hostname', 'options' => array( 'route' => 'reseller.myhost.com', 'constraints' => array( ), 'defaults' => array( 'controller' => 'Reseller\Controller\Reseller', 'action' => 'index' ) ), 'may_terminate' => true, 'child

How can I make the Segment router sanely process constraints in ZF2?

不想你离开。 提交于 2019-12-11 23:49:53
问题 I'm using the Segment router as a child of one of my main Literal routes in a ZF2 (currently using 2.3.5) application. The router needs to be able to handle Turkish input characters coming in from the URL. My first attempt looked something like this (as a child route): 'book' => array( 'type' => 'Zend\Mvc\Router\Http\Segment', 'options' => array( 'route' => 'kitap/:book[/]', 'constraints' => array( 'book' => '[a-zA-ZçÇşŞğĞıİöÖüÜ1-3.+ ]+', ), ), ), This mostly worked for everything I needed it

Zend Framework 2 - ZFCUser action whitelisting does not work for rerouting

夙愿已清 提交于 2019-12-11 13:14:28
问题 I'm using this function for whitelisting a few actions from the ZFCUser login. Everything works great unless I redirect to one of these whitelisted pages. For example I have the myFormAction which reroutes in case of an invalid form to itself or to a successAction . The problem is now that after clicking the button in any of these cases I end up seeing the ZFCUser login. When I go to one of these pages via URL or link there the first time, it works. Here is my code for the two cases in

ZF2 router configuration for subdomain with child routes

一笑奈何 提交于 2019-12-11 01:38:15
问题 I need my router configuration to work as follows: www.bmob.co.uk -> DtCompanyData\Controller\CompanyMap wage.bmob.co.uk -> DtWage\Controller\Wage wage.bmob.co.uk/brighton -> DtWage\Controller\WageBrighton After reading the documentation and many similar questions on here, I can get the routing to work either for the subdomain, or for the child routes, but not both at the same time. When I have // In Application/config/module.config.php: 'home' => array( 'type' => 'hostname', 'options' =>

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 use optional parameters at zend routing

寵の児 提交于 2019-12-08 03:56:39
问题 I want to set a similar routing to the standard-router with optional parameters, e.g.: intranet.route = 'intranet/:controller/:action/:title/:id' only the id-parameter doesn't need a value. i tried giving it an default value like null - but then the variable is still set, but i don't want it to exist at all when the user does not give it any value also, how can i set up a route with dynamic values, just like this: intranet/index/index/Front%20Page/123/foo/bar then the variable $foo exists

Optimizing Zend framework routes

☆樱花仙子☆ 提交于 2019-12-08 03:02:04
问题 I'm using a traditional Zend framework application generated using Zend tool . I have several modules in my application all generated using Zend tool too. I'm intending to use the default routes in Zend framework in my application. For example: www.host.com/module/controller/action/param1/value1/param2/value2 Here are my questions: Performance wise, using the default routes is the fastest solution, right? Since I won't ever change the routes, is there a way to make the routing process even

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

醉酒当歌 提交于 2019-12-07 03:09:42
问题 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/<type> Currently, all I am able to make the following URL: /login/admin /login/moderator My current config file looks like the following: resources.router.routes.login.route = "login/:type" resources.router.routes.login.defaults.controller = "account" resources.router.routes.login.defaults.action = "login" I can't figure out, on