Consultez la FAQ sur le ZF avant de poster une question
Vous n'êtes pas identifié.
Bonjour,
J'ai commencé à étudier le ZF2 la semaine dernière. J'ai donc décidé de suivre le tutoriel officiel du ZF2 (http://framework.zend.com/manual/2.0/en … rview.html) pour avoir une première approche du framework.
J'ai exactement la même erreur qu'ici : http://www.z-f.fr/forum/viewtopic.php?pid=42789#p42789
Je voulais juste savoir si quelqu'un savait d'où provenait l'erreur.
Merci d'avance pour vos réponses.
Cordialement.
Dernière modification par Ali Kent (15-09-2014 18:23:15)
Hors ligne
Bonjour,
Meme question que dans l'autre sujet, utilises-tu un virtualhost, ou un alias ou juste un repertoire a l'interieur de ton document root ?
Quel url appelles-tu et quel est ton probleme exactement (pure 404 ou autre ?).
Pourrais-tu nous poster tes routes ? As-tu installe la toolbar de development ?
Hors ligne
Oui.
Voici ma config:
OS Version : MS Windows 8.1
Apache Version : 2.4.9
PHP Version : 5.5.12
(Je suis sur WAMP)
J'utilise des vhosts, voici mon fichier de conf:
# Base conf
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "C:/wamp/www"
<Directory "C:/wamp/www">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Require local
</Directory>
</VirtualHost>
# VHost Conf for official zf2 tutorial
<VirtualHost *:80>
ServerName zf2-tutorial.localhost
DocumentRoot "C:/Program Files/wamp/www/zf2-tutorial/public"
SetEnv APPLICATION_ENV "development"
<Directory "C:/Program Files/wamp/www/zf2-tutorial/public">
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Voici l'url que j'appel : http://zf2-tutorial.localhost/album
Et voici l'erreur que j'ai :
A 404 error occurred
Page not found.
The requested controller could not be mapped to an existing controller class.
Controller:
not-found(resolves to invalid controller class or alias: not-found)
No Exception available
Hors ligne
J'oubliai les routes :
'router' => array(
'routes' => array(
'album' => array(
'type' => 'segment',
'options' => array(
'route' => '/album[/][:action][/:id]',
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
'id' => '[0-9]+',
),
),
'defaults' => array(
'controller' => 'Album\Controller\Album',
'action' => 'index',
),
),
),
PS : Je vais regarder la doc sur ZF2 Toolbar et l'installer.
Hors ligne
Bonjour,
As-tu bien la cle invocable du tableau ? (dans ton config module, avec ta route)
[lang=php] 'controllers' => array( 'invokables' => array( 'Album\Controller\Album' => 'Album\Controller\AlbumController', ), ),
Hors ligne
Oui c'est ce que j'ai, voici mon fichier module.config.php :
[lang=php] <?php return array( 'controllers' => array( 'invokables' => array( 'Album\Controller\Album' => 'Album\Controller\Album', ), ), 'router' => array( 'routes' => array( 'album' => array( 'type' => 'segment', 'options' => array( 'route' => '/album[/][:action][/:id]', 'constraints' => array( 'action' => '[a-zA-Z][a-zA-Z0-9_-]*', 'id' => '[0-9]+', ), ), 'defaults' => array( 'controller' => 'Album\Controller\Album', 'action' => 'index', ), ), ), ), 'view_manager' => array( 'template_path_stack' => array( 'album' => __DIR__ . '/../view', ), ), );
PS : j'utilise la dernière version de ZF c'est à dire la 2.3
Dernière modification par Ali Kent (16-09-2014 13:22:20)
Hors ligne