Updated the module.config.php to
<code>
<?php
return array(
'di' => array(
'instance' => array(
'Zend\View\Resolver\TemplatePathStack' => array(
'parameters' => array(
'paths' => array(
'WdevBase' => __DIR__ .
'/../view',
) ,
) ,
) ,
// Setup the router and routes
'Zend\Mvc\Router\RouteStack' => array(
'parameters' => array(
'routes' => array(
'WdevBase' => array(
'type' =>
'Zend\Mvc\Router\Http\Literal',
'options' => array(
'route' =>
'/hello/world',
'defaults'
=> array(
'controller' => 'WdevBase\Controller\HelloController',
'action' => 'world',
) ,
) ,
) ,
) ,
) ,
) ,
) ,
// ... other di configuration ...
) ,
);
</code>
And it now renders the view (world.phtml) however i get a notice of a
undefined variable in the world.phtml
<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.0017 374816 {main}( ) ..\index.php:0
2 0.2108 5250312 Zend\Mvc\Application->run( ) ..\index.php:21
3 0.2514 5476304 Zend\Mvc\Application->completeRequest( )
..\Application.php:263
4 0.2514 5476352 Zend\EventManager\EventManager->trigger( )
..\Application.php:278
5 0.2514 5476464 Zend\EventManager\EventManager->triggerListeners( )
..\EventManager.php:202
6 0.2516 5477584 call_user_func ( ) ..\EventManager.php:441
7 0.2516 5477600 Zend\Mvc\View\DefaultRenderingStrategy->render( )
..\EventManager.php:441
8 0.2516 5477600 Zend\View\View->render( )
..\DefaultRenderingStrategy.php:141
9 0.2528 5524648 Zend\View\View->renderChildren( ) ..\View.php:202
10 0.2528 5525216 Zend\View\View->render( ) ..\View.php:236
11 0.2531 5526392 Zend\View\Renderer\PhpRenderer->render( )
..\View.php:209
12 0.2547 5571264 include(
'C:\sites\site\module\WdevBase\view\hello\world.phtml' )
..\PhpRenderer.php:471
".
</code>
My world.phtml code is
<code>
Greetings!
<p>You said "<?php echo $this->escape($foo) ?>".</p>
</code>
--
View this message in context:
http://zend-framework-community.634137.n4.nabble.com/ZF2-Skeleton-Module-and-hello-world-tp4575541p4577199.html
Sent from the Zend Framework mailing list archive at Nabble.com.
--
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]