S'il vous plait j'ai crée un Module Pizza avec un view index.phtml, j'ai un probleme lorsque j'essaie d'accéder a cette view par l'url:
http://localhost:8080/pizza/public/pizza.

index.phtml est localisé dans C:\wamp\www\pizza\module\Pizza\view\pizza\pizza.

voila l'erreur qui s'afficher:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Zend\View\Renderer\PhpRenderer::render: Unable to render template "pizza/pizza/index"; resolver could not resolve to a file
 
 
#0 C:\wamp\www\pizza\vendor\zendframework\zendframework\library\Zend\View\View.php(205): Zend\View\Renderer\PhpRenderer->render(Object(Zend\View\Model\ViewModel))
#1 C:\wamp\www\pizza\vendor\zendframework\zendframework\library\Zend\View\View.php(233): Zend\View\View->render(Object(Zend\View\Model\ViewModel))
#2 C:\wamp\www\pizza\vendor\zendframework\zendframework\library\Zend\View\View.php(198): Zend\View\View->renderChildren(Object(Zend\View\Model\ViewModel))
#3 C:\wamp\www\pizza\vendor\zendframework\zendframework\library\Zend\Mvc\View\Http\DefaultRenderingStrategy.php(102): Zend\View\View->render(Object(Zend\View\Model\ViewModel))
#4 [internal function]: Zend\Mvc\View\Http\DefaultRenderingStrategy->render(Object(Zend\Mvc\MvcEvent))
#5 C:\wamp\www\pizza\vendor\zendframework\zendframework\library\Zend\EventManager\EventManager.php(468): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#6 C:\wamp\www\pizza\vendor\zendframework\zendframework\library\Zend\EventManager\EventManager.php(207): Zend\EventManager\EventManager->triggerListeners('render', Object(Zend\Mvc\MvcEvent), Array)
#7 C:\wamp\www\pizza\vendor\zendframework\zendframework\library\Zend\Mvc\Application.php(352): Zend\EventManager\EventManager->trigger('render', Object(Zend\Mvc\MvcEvent))
#8 C:\wamp\www\pizza\vendor\zendframework\zendframework\library\Zend\Mvc\Application.php(327): Zend\Mvc\Application->completeRequest(Object(Zend\Mvc\MvcEvent))
#9 C:\wamp\www\pizza\public\index.php(17): Zend\Mvc\Application->run()
#10 {main}
S'il vous plait, aidez moi a detecter l'erreur, et Merci d'avance.

voila module.config.php:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
 
 return array( 
			 'controllers' => array(
			       'invokables' => array('Pizza\Controller\Pizza' => 'Pizza\Controller\PizzaController'),
				   ), 
			 'router' => array(
			  		'routes' => array(
							'pizza' => array(
							          'type'=> 'segment', 
									  'options' => array(
															          'route' => '/pizza[/][:action][/:id]', 
 															          'constraints' => array(
																					'action' => '[a-zA-Z][a-zA-Z0-9_-]*', 																																																				                                                                             		'id' => '[0-9]+'),
                                                                      'defaults' => array( 
																				   'controller'=> 'Pizza\Controller\Pizza', 
																				   'action' =>	'index'),	 												
														)
									       )
							         )
					             ),
             'view manager' => array('template_path_stack' => array('pizza' => __DIR__.'/../view'),), 
			 );
et voila module.php:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
 
namespace Pizza;
 
class Module {
 
	public function getAutoLoaderConfig()
	{
		return array(
			'Zend\Loader\ClassMapAutoLoader' => array(__DIR__.'/autoload_classmap.php',),
			'Zend\Loader\StandardAutoloader' => array(
				'namespaces' => array(__NAMESPACE__ => __DIR__.'/src/'.__NAMESPACE__,),
				),
				);
	}
 
	public function getConfig()
	{
		return include __DIR__.'/config/module.config.php';
	}
 
}