Consultez la FAQ sur le ZF avant de poster une question
Vous n'êtes pas identifié.
Bonsoir a tous,
voila je decouvre zend et ca m'interesse bcq ,bon je cherche des tutoriels en francais ,merci bien
Hors ligne
Bonjour,
Tu peux te tourner du côté du tutoriel Débuter avec Zend Framework, d'Akrabat (Rob Allen), traduction de Bernard Opic.
Hors ligne
bsr, merci bien pour le tuto mais j'ai un probleme , la connexion avec la base de donnée ne marche pas, ca peut etre quoi le probleme??
Hors ligne
Bonjour,
As-tu un message d'erreur ?
Le module PDO est-il activé sur ton serveur ? Je ne me souviens plus quelles sont les valeurs à mettre si PDO n'est pas activé, mais il faut utiliser mysqli.
Hors ligne
oui voila les msgs d'erreur :
-->Warning: require_once(Zend/Loader/Autoloader.php) [function.require-once]: failed to open stream: No such file or directory in C:\wamp\www\tutoriel-zf\public\index.php
-->Fatal error: require_once() [function.require]: Failed opening required 'Zend/Loader/Autoloader.php' (include_path='.;C:\php\pear') in C:\wamp\www\tutoriel-zf\public\index.php
Hors ligne
As-tu bien mis la librairie Zend dans le dossier library ?
Hors ligne
oui oui biensur
Hors ligne
jpense qu'il ya un probleme dans l 'include_path mais je c pa exactement comment le modifier,ou le mettre deja c flou :s
Hors ligne
Qu'as-tu dans ton index.php ? On dirait que ton include path est en effet incorrect.
Un index.php de ZF 1.11 :
[lang=php] <?php // Define path to application directory defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(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'), 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();
Hors ligne
<?php
require_once 'Zend/Loader/Autoloader.php';
Zend_Loader::registerAutoload();
Zend_Controller_Front::run('../application/controllers');
$params = array ('host' => 'localhost',
'username' => 'root',
'password' => '123456',
'dbname' => 'tutoriel-zf' );
$db = Zend_Db::factory('PDO_MYSQL', $params);
// Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(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'),
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();
Hors ligne
Qu'est-ce que c'est les premières lignes ?
Au moment où elles sont exécutées, on a pas encore défini l'include path...
La configuration de la BDD se fera via le fichier application.ini, dans application/config/
Hors ligne
ok j'ai fait ca dans application.ini
resources.db.adapter = "PDO_MYSQL"
resources.db.params.host = "localhost"
resources.db.params.username = "root"
resources.db.params.password = "123456"
resources.db.params.dbname = "tutoriel-zf"
mais je c pa koi ecrire dans index.php
Hors ligne
Ton index.php ne doit contenir que les lignes par défaut étant donné que tu n'as pas de besoin de choses spécifiques :
[lang=php] // Define path to application directory defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(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'), 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();
Hors ligne
ok je vous remercie monsieur pour votre temps
Hors ligne
Pas de soucis, tout le plaisir est pour moi !
Hors ligne