Skip to content

Instantly share code, notes, and snippets.

@magickatt
Last active January 3, 2016 07:09
Embed
What would you like to do?
Route-based parameters in Zend Framework 2 view helper
<?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