zend-route

How to set up Hierarchical Zend Rest Routes?

耗尽温柔 提交于 2019-11-28 18:59:08
With the Zend Framework, I am trying to build routes for a REST api on resources organized in the following pattern: http://example.org/users/ http://example.org/users/234 http://example.org/users/234/items http://example.org/users/234/items/34 How do I set up this with Zend_Rest_Route? Here is how I have setup the route for the users resource (users/:id) in my bootstrap.php file: $this->bootstrap('frontController'); $frontController = Zend_Controller_Front::getInstance(); $restRoute = new Zend_Rest_Route($frontController); $frontController->getRouter()->addRoute('default', $restRoute); [As

Route mit special characters are not parsed correctly in Zend Framework 2

删除回忆录丶 提交于 2019-11-28 12:57:55
URIs with german special characters don't work (error 404). I've already had this problem ( here ) and it has been resolved with the unicode modifier and a custom view helper , that uses it. Now I have the same issue with a Segment child route, but this time the approach with the unicode identifier and a custom view helper isn't working. Alle requests like sld.tld/sport/sportäöüÄÖÜß/cityäöüÄÖÜß or sld.tld/sport/sportäöüÄÖÜß/cityäöüÄÖÜß/page/123 are ending with a 404 error. /module/Catalog/config/module.config.php <?php return array( ... 'router' => array( 'routes' => array( 'catalog' => array(

ZF2 - Injecting pages to navigation before controller is called

蹲街弑〆低调 提交于 2019-11-28 09:48:12
问题 I'm creating a dynamic Application in which the content is added through a CMS. Inside the CMS, I'm setting a db entry which states what module to use for each content page. NodeId, ParentNodeId, Name_de, Name_en, ModuleName, foreignkey_ContentLinks, in this table entries look as follows: 6, 1, Veranstaltung-21-02-2013, Event-21-02-2013, Events, 682 The entire tree should end up in my navigation (and perfectly also in my routing). I do not want to add it in some controller, because my

What is 'may_terminate' in zend framework 2?

自古美人都是妖i 提交于 2019-11-27 13:04:49
问题 I am beginner working with Zend. I have seen may_terminate in module route configuration. I don't understand what it is for. According to ZF2 official docs, the option “may_terminate” hints to the router that no other segments will follow it. Still I don't get the meaning of no other segments will follow it . What is it here? Can anyone please explain it with small example? 回答1: The may_terminate option will indicate to the router that 'this' route is able to be matched solely on the value of

How to access route, post, get etc. parameters in Zend Framework 2

佐手、 提交于 2019-11-26 19:23:34
How can I get various parameters related to the page request in zf2? Like post/get parameters, the route being accessed, headers sent and files uploaded. The easiest way to do that would be to use the Params plugin , introduced in beta5. It has utility methods to make it easy to access different types of parameters. As always, reading the tests can prove valuable to understand how something is supposed to be used. Get a single value To get the value of a named parameter in a controller, you will need to select the appropriate method for the type of parameter you are looking for and pass in the

How to access route, post, get etc. parameters in Zend Framework 2

梦想与她 提交于 2019-11-26 06:57:30
问题 How can I get various parameters related to the page request in zf2? Like post/get parameters, the route being accessed, headers sent and files uploaded. 回答1: The easiest way to do that would be to use the Params plugin, introduced in beta5. It has utility methods to make it easy to access different types of parameters. As always, reading the tests can prove valuable to understand how something is supposed to be used. Get a single value To get the value of a named parameter in a controller,