This is the route...
'panel-list' => array (
'type' => 'Segment',
'options' => array (
'route' => '/panel-list/:pageId[/:action]',
'constraints' => array (
'pageId' => '[a-z0-9_-]+'
),
'defaults' => array (
'action' => 'index',
'controller' => 'PanelList',
'site' => null
),
),
),
What do I need to put in here....
public function indexAction()
{
echo ???????
}
to echo the pageId?
Have you tried
$this->getEvent()->getRouteMatch()->getParam('pageId');
In beta5 of zf2 it changed to easier usage so you don't need to remember different syntax for every different type. I cite:
So to get a parameter from the route, all you need to do is.
This can also be done with query ($_GET) and post ($_POST) etc. as the citation says.
Example:
if the url is someurl?pageId=33 $param will hold the value 33. if the url doesn't have ?pageId $param will hold the value 55