zend-route

How to create a custom router in Zend-Framework?

佐手、 提交于 2019-12-25 04:42:56
问题 I am using a custom Router to enable pages like: mytutorialsite.com/category/:categoryname # added to application.ini resources.router.routes.categorynameOnCategory.route = /category/:categoryname resources.router.routes.categorynameOnCategory.defaults.module = default resources.router.routes.categorynameOnCategory.defaults.controller = category resources.router.routes.categorynameOnCategory.defaults.action = categoryname I also have database table 'categories' in which all categories are

How to redirect Error Page and perform Routes in Zend Framework 1.x

丶灬走出姿态 提交于 2019-12-24 03:37:55
问题 How to perform routes in Zend Framework 1.x and also redirect custom error messages? 回答1: To perform customized routes: Put the following in your bootstrap.php file function _initRoutes() { $front_controller = Zend_Controller_Front::getInstance(); $router = $front_controller->getRouter(); $router->addRoute('customName', new Zend_Controller_Router_Route( '/customName/:dataVariable', array('controller' => 'YourController', 'action' => 'YourAction') )); } then, in your controller action, you

404 The requested URL could not be matched by routing

心已入冬 提交于 2019-12-23 12:42:58
问题 I'd just started to learn zend-framework and following this user guide. I'm able to successfully install the zend skeleton application and moved on to the routing and controllers. But after completion of the tutorial I requested the url: http://zf2-tutorial.localhost/album in my browser and I'm getting 404 . I'd looked down into the comments where some people saying about changes in 'route' => '/album[/][:action][/:id]' needs to be 'route' => '/album[/:action][/:id]' but that doesn't help

Zend framework not able to route the translated child routes

筅森魡賤 提交于 2019-12-23 10:12:03
问题 I am new to Zend framework 3 and was trying to translate the routes and i have partially succeeded.I am able to translate the main route and redirect it to the required location but for child routes the translation works but the redirection doesn't. can you please help me, my code is below. module.config.php 'router' => [ 'router_class' => TranslatorAwareTreeRouteStack::class, 'routes' => [ 'setting' => [ 'type' => Segment::class, 'options' => [ 'route' => '/{locale}/{setting}', 'defaults' =>

Zend Framework - Where to put the robots.txt file?

跟風遠走 提交于 2019-12-23 02:52:36
问题 Zend framework i have directory tree as following with robots.txt file, but when i browse www.site.com/robots.txt , it says page not found error. How do i tell ZF that robots.txt is allowed? A. Directory tree: wwwsite/application wwwsite/library wwwsite/ZendFramework-1.10.7.tar.gz wwwsite/public . |--- captcha | |--- css |--- js |--- img |--- files | .htaccess index.php robots.txt B. .htaccess RewriteEngine On RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR]

URL rewriting for Magento module

对着背影说爱祢 提交于 2019-12-21 02:46:07
问题 I have created a New Module in Magento and named it as "article". It has two Front end controllers index and article. And in the article controller i have an action called "archives" to list the articles on the front end / website based on the archives. Everything is fine except the URL. The Working URL right now is : [http://]mydemostore/article/article/archives/01/2011 What i actually need is http://mydemostore/article/archives/01/2011 I don't want to have an extra "article" (the controller

Zend Form SetAction Using Named Routes

倾然丶 夕夏残阳落幕 提交于 2019-12-18 13:14:34
问题 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 do something like $this->url(array(), 'route-name'); in the view, or $this->_helper->url(array(), 'route-name'); in the controller. How do I call a route from within Zend_Form? edit: I have given up trying to load a route into zend_form. Perhaps in

double slash in URLs.

拥有回忆 提交于 2019-12-14 03:11:49
问题 Zend Route issue. Normally it works fine. http://www.example.com/course-details/1/Physics-Newtons-Law But if I type in an extra slash in the url, the noauthAction of my Error controller gets called. Example of URL's that are not working. http://www.example.com/course-details//1/Physics-Newtons-Law http://www.example.com/course-details/1//Physics-Newtons-Law Is there something I need to set in the route definition to allow extra slashes? Routing in application.ini resources.router.routes

Zend_Controller_Router_Route_Regex rewrite all my module links

Deadly 提交于 2019-12-13 05:13:29
问题 I'm using Zend_Framework 1. In my Bootstrap.php I rewrite my categories link something like that: $route = new Zend_Controller_Router_Route_Regex("^([a-z,0-9,-]*)(/|)([a-z,0-9,-]*)(/|)([a-z,0-9,-]*)(/|)([a-z,0-9,-]*)(/|)([a-z,0-9,-]*)(/date/|)([a-z]*)(/page/|)([0-9]*)$", array( "module" => "default", "controller" => "categories", "action" => "index" ), array( 1 => 'firstparam', 3 => 'secondparam', 5 => 'theeparam', 7 => 'fourparam', 9 => 'fiveparam', 11 => 'date', 13 => 'page', ) ); $router-

action parameters routing not working in Zend framework routes.ini

不羁的心 提交于 2019-12-13 03:53:51
问题 I'm trying to set up a route in Zend Framework (version 1.11.11) in a routes.ini file, which would allow be to match the following url: my.domain.com/shop/add/123 to the ShopController and addAction . However, for some reason the parameter (the number at the end) is not being recognized by my action. The PHP error I'm getting is Warning: Missing argument 1 for ShopController::addAction(), called in... I know I could set this up using PHP code in the bootstrap, but I want to understand how to