Bonjour, débutant sous Zend, j'ai encore quelques souci pour récupérer et afficher mes données de ma base SQL.
Voici l'erreur qu'il m'affiche à l'écran :
Fatal error: Class 'Model_DbTable_VueIncident' not found in C:\wamp\www\Zend1.11.5\application\controllers\VueIncidentController.php on line 13
Voici mon index.php :
Voici mon application.ini :
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 <?php // Define path to application directory defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '\..\application')); echo dirname(dirname(__FILE__) . '\..\application'); // Define application environment defined('APPLICATION_ENV') || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production')); // Ensure library/ is on include_path set_include_path(implode(PATH_SEPARATOR, array( realpath(APPLICATION_PATH . '/../library'), realpath(APPLICATION_PATH . '/models'), get_include_path(), ))); /** Zend_Application **/ require_once 'Zend/Application.php'; // Create application, bootstrap, and run $application = new Zend_Application( APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini' ); $application->bootstrap() ->run();
Mon controller :
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 [production] phpSettings.date.timezone = "Europe/Paris" phpSettings.display_startup_errors = 0 phpSettings.display_errors = 0 includePaths.library = APPLICATION_PATH "/../library" bootstrap.path = APPLICATION_PATH "/Bootstrap.php" bootstrap.class = "Bootstrap" appnamespace = "Application" resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers" resources.frontController.params.displayExceptions = 0 resources.view.doctype = "XHTML1_STRICT" resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/" [connexion] resources.db.adapter = sqlsrv resources.db.params.host = PCISINSTDEV\SQLEXPRESS resources.db.params.username = nom resources.db.params.password = motdepasse resources.db.params.dbname = nomdelabase resources.db.isDefaultTableAdapter = true [staging : production] [testing : production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 [development : production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 resources.frontController.params.displayExceptions = 1
Mon model :
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 <?php class VueIncidentController extends Zend_Controller_Action { public function init() { /* Initialize action controller here */ } function indexAction() { $oIncident = new Model_DbTable_VueIncident(); $this->view->VUE_INCIDENT = $oIncident->fetchAll(); } }
Et ma vue :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 <?php class Model_DbTable_VueIncident extends Zend_Db_Table_Abstract { protected $_name = '[dbo].[VUE_INCIDENT]'; protected $_primary = '[CLE_INCIDENT]'; }
Désoler, pour tous ce code mais est-ce quelqu'un à un avis sur l'erreur affiché ???
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 <table> <tr> <th>Numéro incident</th> <th>Descriptif</th> </tr> <?php foreach($this->VUE_INCIDENT as $incident) : ?> <tr> <td><?php echo $incident->NO_INCIDENT;?></td> <td><?php echo $incident->DESCRIPTIF;?></td> </tr> <?php endforeach; ?> </table>
Merci d'avance
PS : J'utilise Zend 1.11.5 avec WampServer 2.0i et SQL Server 2008
Partager