some image

Tag zf2

zend framework 2 (zf2) — Url Helper для Wildcard маршрута

Метки: , Работа

Есть маршрут:

'application' => array(
	'type' => 'segment',
	'options' => array(
		'route'    => '/application[/:controller][/:action]',
		'defaults' => array(
			'__NAMESPACE__' => 'Application\Controller',
			'controller'    => 'Index',
			'action'        => 'index',
		),  
	),
	'may_terminate' => true,
	'child_routes' => array(
			'default' => array(
					'type'    => 'Wildcard',
					'options' => array(
					),
			),
	),
),  

URL helper для него выглядит следующим образом (обратите внимание на application/default):

$this->url('application/default', array('controller' => 'advert', 'action' => 'index', 'phone' => $row->data['phone'] ) );