work-out-web/url-from-object

Una libreria per gestire collegamenti tra oggetti e rotte

Installs: 71

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/work-out-web/url-from-object

1.2.1 2016-02-19 09:37 UTC

This package is not auto-updated.

Last update: 2025-11-05 17:00:47 UTC


README

Semplice classe per generare url a partire da un oggetto.

in view: <?php echo $this->urlFromObject('nome-pagina', $object) ?>

in controller: $url = $this->urlFromObject('nome-pagina', $object);

Per configurare i generatori di url utilizzare la seguenti sintassi.

'url-from-object' => array(

	/* generator */
	'Application\Model\User' => array(
		'edit-page' => function($object){
			return array(
				'route' => 'application/default',
				'params' => array(
					'controller' => 'user',
					'action' => 'edit',
        		)
        	);
        },

		/*static*/
		'list-page' => array(
			'route' => 'application/default',
			'params' => array(
				'controller' => 'user',
			    'action' => 'index',
			)
        ),

 	 /* alias */
     'Application\Controller\IndexController' => 'Zend\View\Renderer\PhpRenderer',
),