PHP code example of work-out-web / url-from-object

1. Go to this page and download the library: Download work-out-web/url-from-object library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

work-out-web / url-from-object example snippets

` echo $this->urlFromObject('nome-pagina', $object) 
` $url = $this->urlFromObject('nome-pagina', $object);
`
'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',
),