fwahlqvist wrote
> 
> But should not this URL work then?
> "http://site.local/hello/world?message=bar"; and not give me this
> 
> <code>
> Greetings!
> You said "
> 
> ( ! ) Notice: Undefined variable: foo in
> C:\sites\site\module\WdevBase\view\hello\world.phtml on line 3
> Call Stack
> #     Time    Memory  Function        Location
> 1     0.0064  376000  {main}( )       ..\index.php:0
> 2     0.2263  5252448 Zend\Mvc\Application->run( )    ..\index.php:21
> 3     0.2704  5478440 Zend\Mvc\Application->completeRequest( )
> ..\Application.php:263
> 4     0.2705  5478488 Zend\EventManager\EventManager->trigger( )
> ..\Application.php:278
> 5     0.2705  5478600 Zend\EventManager\EventManager->triggerListeners( )
> ..\EventManager.php:202
> 6     0.2706  5479720 call_user_func ( )      ..\EventManager.php:441
> 7     0.2706  5479736 Zend\Mvc\View\DefaultRenderingStrategy->render( )
> ..\EventManager.php:441
> 8     0.2707  5479736 Zend\View\View->render( )
> ..\DefaultRenderingStrategy.php:141
> 9     0.2720  5526776 Zend\View\View->renderChildren( )       ..\View.php:202
> 10    0.2720  5527344 Zend\View\View->render( )       ..\View.php:236
> 11    0.2724  5528520 Zend\View\Renderer\PhpRenderer->render( )
> ..\View.php:209
> 12    0.2742  5573392 include(
> 'C:\sites\site\module\WdevBase\view\hello\world.phtml' )
> ..\PhpRenderer.php:471
> </code>
> 
Change your route to:
'route' => '/hello/world*[/:foo]*', 

in your controller add the following:
$foo = $this->getEvent()->getRouteMatch()->getParam('foo');
return array('foo' => $foo);


--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/ZF2-Skeleton-Module-and-hello-world-tp4575541p4581969.html
Sent from the Zend Framework mailing list archive at Nabble.com.

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to