Consultez la FAQ sur le ZF avant de poster une question
Vous n'êtes pas identifié.
je viens de passer à la version 1.8.4 , l'amorçage est le suivant ci c'est bien correcte.
index.php
<?php
// Set the initial include_path. You may need to change this to ensure that
// Zend Framework is in the include_path; additionally, for performance
// reasons, it's best to move this to your web server configuration or php.ini
// for production.
$library = 'C:\wamp\ZendFramework-1.8.4\library';
set_include_path ( $library . PATH_SEPARATOR . get_include_path () );
// 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'));
/** 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();
$application->run();Bootstrap.php
<?php
/**
* Application bootstrap
*
* @uses Zend_Application_Bootstrap_Bootstrap
* @package QuickStart
*/
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
/**
* Bootstrap autoloader for application resources
*
* @return Zend_Application_Module_Autoloader
*/
protected function _initAutoload()
{
$autoloader = new Zend_Application_Module_Autoloader(array(
'namespace' => 'Default',
'basePath' => dirname(__FILE__),
));
return $autoloader;
}
/**
* Bootstrap the view doctype
*
* @return void
*/
protected function _initDoctype()
{
$this->bootstrap('view');
$view = $this->getResource('view');
$view->doctype('XHTML1_STRICT');
}
}Mes questions sont les suivantes
1-Est ce c'est obligatoire de passer par les loyouts ?
<?php echo $this->layout()->content ?>
2-ainsi comment on fait pour fixer la baseurl ?
3-comment me déplacer entre contrôleur ?
mon autre probleme aussi est que j'ai pas pu me déplacer entre contrôleur
$this->_redirect ( 'authentif/login' );
si je fais la re-direction depuis l'index je reste bloquer dans le contrôleur courant avec un ajout du deuxième contrôleur
l'url devient le suivant :
[citation]
http://localhost/zend-test/public/index.php/index/logout/controllers/auth
[/citation]
je fais la redirection de puis la vu de l'index ainsi
<a href="<?=$this->url(array('controllers'=>'auth','action'=>'logout'))?>">click here to logout</a>Hors ligne
http://localhost/zend-test/public/index.php/index/logout/controllers/auth
<a href="<?=$this->url(array('controllers'=>'auth','action'=>'logout'))?>">click here to logout</a>
Juste une remarque qui pourrais t'aider :
Pour acceder à cette url :
http://localhost/zend-test/public/auth/logout/
il suffit d'enlever le S de controllers comme ceci :
<a href="<?=$this->url(array('controller'=>'auth','action'=>'logout'))?>">click here to logout</a>
Bonne journée
Hors ligne