Witam,
Mam problem z wygenerowaniem routingu. Tworzę formularz. W templatce chcę ustawić akcje, do której ma być wysłany formularz. Chciałbym wygenerować taki url " localhost/public/application/index/convert"
Pod tą akcje mogę wejść i dostaje akcje convert. Plik module.config.php jest standardowy (projekt dopiero utworzony)
Ustawienie w templatce:
$form = $this->form;
$form->setAttribute('action', $this->url('application/index', array('action' => 'convert'))); $form->prepare();
Plik z routingiem
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link <a href="http://github.com/zendframework/ZendSkeletonApplication" target="_blank">http://github.com/zendframework/ZendSkeletonApplication</a> for the canonical source repository
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
* @license <a href="http://framework.zend.com/license/new-bsd" target="_blank">http://framework.zend.com/license/new-bsd</a> New BSD License
*/
'type' => 'Zend\Mvc\Router\Http\Literal',
'route' => '/',
'controller' => 'Application\Controller\Index',
'action' => 'index',
),
),
),
// The following is a route to simplify getting started creating
// new controllers and actions without needing to create a new
// module. Simply drop new controllers in, and you can access them
// using the path /application/:controller/:action
'type' => 'Literal',
'route' => '/application',
'__NAMESPACE__' => 'Application\Controller',
'controller' => 'Index',
'action' => 'index',
),
),
'may_terminate' => true,
'type' => 'Segment',
'route' => '/[:controller[/:action]]',
'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
),
),
),
),
),
),
),
),
'service_manager' => array( 'abstract_factories' => array( 'Zend\Cache\Service\StorageCacheAbstractServiceFactory',
'Zend\Log\LoggerAbstractServiceFactory',
),
'translator' => 'MvcTranslator',
),
),
'locale' => 'en_US',
'translation_file_patterns' => array( 'type' => 'gettext',
'base_dir' => __DIR__ . '/../language',
'pattern' => '%s.mo',
),
),
),
'Application\Controller\Index' => 'Application\Controller\IndexController'
),
),
'display_not_found_reason' => true,
'display_exceptions' => true,
'doctype' => 'HTML5',
'not_found_template' => 'error/404',
'exception_template' => 'error/index',
'layout/layout' => __DIR__ . '/../view/layout/layout.phtml',
'application/index/index' => __DIR__ . '/../view/application/index/index.phtml',
'error/404' => __DIR__ . '/../view/error/404.phtml',
'error/index' => __DIR__ . '/../view/error/index.phtml',
),
'template_path_stack' => array( __DIR__ . '/../view',
),
),
// Placeholder for console routes
),
),
),
);