hello for all Zend developpers;
i need some help plz,
i have folow the zend tutoriels in this link (
http://www.dator.fr/la-
serie-de-tutoriaux-sur-la-creation-dune-application-avec-le-zend-
framework/)
in the 3rd part : i have a problem and i can't find the source:
i have :
--Application
--------Bootstrap.php
--------configs
----------------application.ini
--------models
----------------DbTable
----------------------Bureaux.php
--------modules
---------------frontend
----------------------controllers
------------------------------IndexController.php
----------------------views
-----------------------------scripts
------------------------------------index
------------------------------------------index.phtml
--------views
--library
--public
---------index.php
in index.php file (located in public folder i have)
//*******************
<?php
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../
application'));
defined('LIBRARY_PATH')
|| define('LIBRARY_PATH', realpath(dirname(__FILE__) . '/../
library'));
defined('ZEND_PATH')
|| define('ZEND_PATH', realpath(dirname(__FILE__) . '/../
library'));
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ?
getenv('APPLICATION_ENV') : 'production'));
// On modifie l'include path de PHP
set_include_path(implode(PATH_SEPARATOR, array(
realpath(ZEND_PATH),
get_include_path(),
)));
// On a besoin de Zend Application pour lancer notre application
require_once 'Zend/Application.php';
// On lance la session
require_once 'Zend/Session.php';
Zend_Session::start();
// On créé l'application, on lance le bootstrap et on lance
l'application !
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
$application->bootstrap()
->run();
//**********************
in Bootstrap.php file (located in application folder i have)
//*******************
<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
public function run()
{
// Cela permet d'avoir la configuration disponible de partout
dans notre application
Zend_Registry::set('config', new Zend_Config($this-
>getOptions()));
parent::run();
}
protected function _initAutoload()
{
// On enregistre les modules (les parties de notre
application), souvenez-vous : Backend et Frontend
$loader = new Zend_Application_Module_Autoloader(array(
'namespace' => '',
'basePath' => APPLICATION_PATH));
return $loader;
}
protected function _initSession()
{
// On initialise la session
$session = new Zend_Session_Namespace('watchmydesk',
true);
return $session;
}
protected function _initView()
{
// Initialisation de la vue et des helpers de vue
$view = new Zend_View();
$view->doctype('XHTML1_STRICT');
// On ajoute le dossier des helpers
$view->addHelperPath(APPLICATION_PATH . '/views/helpers');
// On charge l'helper qui va se charger de la
vue
$viewRenderer =
Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
$viewRenderer->setView($view);
return $view;
}
}
//******************
application\modules\frontend\controllers\IndexController.php
//*******************
<?php
class IndexController extends Zend_Controller_Action {
public function indexAction(){
$bureaux = new Model_DbTable_Bureaux();
var_dump($bureaux->fetchAll());
}
}
//******************