Last active
January 3, 2016 07:09
-
-
Save magickatt/8427248 to your computer and use it in GitHub Desktop.
Route-based parameters in Zend Framework 2 view helper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Output the URL in the view | |
echo $this->url('somewhere', | |
array('controller' => 'company', | |
'action'=>'edit', | |
'id' => $company->id | |
) | |
); | |
// Access the corresponding parameter in a controller | |
$this->params()->fromRoute('id'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment