Consultez la FAQ sur le ZF avant de poster une question
Vous n'êtes pas identifié.
Bonjour,
J'ai suivi le tuto ZF http://g-rossolini.developpez.com/tutor … k/debuter/ mais je n'arrive pas à ajouter un controleur. J'utilise la ligne de commande, les fichiers sont générés, mais je n'arrive pas à y accéder.
Mon appli s'appelle adaxys. J'ai un controleur par défaut (index), accessible sur :
http://localhost/adaxys/public
Mais lorsque j'accède à
http://localhost/adaxys/clients j'ai une erreur 404.
Pouvez vous m'aider ?
Merci.
Dripple
Dernière modification par Dripple (28-05-2009 15:17:46)
Hors ligne
Salut Dripple,
En accédant à l'adresse http://localhost/adaxys/punlic tu devrais tomber sur le controller punlic, et non index... Peut-être que du code nous permettrait de mieux comprendre la source de ton problème.
Cordialement,
Hors ligne
Arborescence :
- public/index.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();public/.htaccess
SetEnv APPLICATION_ENV development
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]- application/Bootstrap.php
<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
protected function _initAutoload()
{
$moduleLoader = new Zend_Application_Module_Autoloader(array(
'namespace' => '',
'basePath' => APPLICATION_PATH));
return $moduleLoader;
}
function _initViewHelpers()
{
$this->bootstrap('layout');
$layout = $this->getResource('layout');
$view = $layout->getView();
$view->doctype('XHTML1_STRICT');
$view->headMeta()->appendHttpEquiv('Content-Type', 'text/html;charset=utf-8');
$view->headTitle()->setSeparator(' - ');
$view->headTitle('Adaxys Customer Managment');
}
}Ensuite, les autres fichiers sont générés par l'outil ligne de commande et je n'ai rien modifié...
Hors ligne