Bonjour,
Je suis débutante et je veux utiliser le framework zend pour mon projet.
J'ai suivi le tutoriel "Débuter avec Zend Framework 1.5 (approche MVC)"
j'ai un petit problème au niveau des liens lorsque je clique sur le lien "Ajouter un nouvel album" je tombe sur une page "Objet non trouvé! Erreur 404".
le code mon index.php
et le code du page index.phtml est :
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
24
25
26
27
28
29
30
31
32
33
34
35 <?php error_reporting(E_ALL|E_STRICT); ini_set('display_errors', 1); date_default_timezone_set('Europe/Paris'); // mise en place des répertoires et chargement des classes set_include_path('.' . PATH_SEPARATOR . './library' . PATH_SEPARATOR . './application/models/' . PATH_SEPARATOR . get_include_path()); include "Zend/Loader.php"; Zend_Loader::registerAutoload(); // Chargement de la configuration $config = new Zend_Config_Ini('./application/config.ini', 'general'); $registry = Zend_Registry::getInstance(); $registry->set('config', $config); // Mise en place de la BDD $db = Zend_Db::factory($config->db); Zend_Db_Table::setDefaultAdapter($db); // setup controller $frontController = Zend_Controller_Front::getInstance(); $frontController->throwExceptions(true); $frontController->setControllerDirectory('./application/controllers'); $frontController->setBaseUrl('/zenfacile'); Zend_Layout::startMvc(array('layoutPath'=>'./application/layouts')); // run! $frontController->dispatch(); ?>
Voici mon arboresence :
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 <p><a href="<?php echo $this->url(array('controller'=>'index', 'action'=>'ajouter')); ?>">Ajouter un nouvel album</a></p> <table> <tr> <th>Title</th> <th>Artist</th> <th> </th> </tr> <?php foreach($this->albums as $album) : ?> <tr> <td><?php echo $this->escape($album->title);?></td> <td><?php echo $this->escape($album->artist);?></td> <td> <a href="<?php echo $this->url(array('controller'=>'index', 'action'=>'modifier', 'id'=>$album->id));?>">Modifier</a> <a href="<?php echo $this->url(array('controller'=>'index', 'action'=>'supprimer', 'id'=>$album->id));?>">Supprimer</a> </td> </tr> <?php endforeach; ?> </table>
-Zenfacile
------index.php
------htaccess
------application
------------config.ini
------------controllers
------------layouts
------------models
------------views
----------------helpers
----------------scripts
------library
------public
------------css
Avez vous d'idée???
Merci d'avance
Partager