Consultez la FAQ sur le ZF avant de poster une question
Vous n'êtes pas identifié.
Pages: 1
Salut à tous,
Je ne suis pas à mon premier site n ZF, mais là, je sèche
Je dois l'installer sur un server online, de test, de ce style : http://client.maboite.fr/monclient/www-root
Mais mes css et js ne sont pas pris en compte, l'url n'est pas bonne. voici :
htaccess :
RewriteEngine On #RewriteBase / SetEnv APPLICATION_ENV "development" RewriteRule !.(js|css|ico|gif|jpg|png|less)$ index.php RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] #RewriteRule ^.*$ index.php [NC,L]
Layout :
<?php echo $this->doctype()?> <head> <?php echo $this->headMeta(); echo $this->headTitle(); echo $this->headLink(); $local = true; // Utilisation de jquery et jqueryUI if (! $local) { if ($this->jQuery()->isEnabled()) { echo $this->jQuery() ->setVersion('1.6.2') ->setUIVersion('1.8.2'); } } else { ?> <script type="text/javascript"src="<?php echo $this->baseUrl()?>js/jquery/jquery-1.6.2.min.js"></script> <script type="text/javascript" src="<?php echo $this->baseUrl()?>js/jquery/jquery-ui-1.8.2.custom.min.js"></script> <?php } ?> .... .... ....
Les css sont géré dans :
<?php class Custom_Controller_Action_Helper_View { public $view; public function __construct ($view) { $this->view = $view; } public function init () { // set encoding and doctype $this->view->setEncoding('UTF-8'); // setting the site in the title $this->view->headTitle(''); // setting a separator string for segments: $this->view->headTitle()->setSeparator(' - '); $this->view->doctype('HTML5'); $this->view->headMeta() ->setHttpEquiv('Content-Type', 'text/html; charset=UTF-8') ->setHttpEquiv('Content-Language', 'fr-FR'); //$this->view->headMeta()->setCharset('UTF-8'); $front = Zend_Controller_Front::getInstance(); $request = $front->getRequest(); $moduleName = $request->getModuleName(); if (! empty($moduleName)) { $this->view->headLink() ->appendStylesheet('/css/' . $moduleName . '/style.css?v=2') ->appendStylesheet(array('rel' => 'stylesheet/less', 'href' => '/css/' . $moduleName . '/content.less')); } // adding scripts $this->view->headScript() ->appendFile('/js/head.min.js', 'text/javascript') ->appendFile('/js/' . $moduleName . '/load-headjs.js', 'text/javascript'); //Activation de Jquery $this->view->addHelperPath('ZendX/JQuery/View/Helper/', 'ZendX_JQuery_View_Helper'); $jquery = $this->view->jQuery(); $jquery->enable()->uiEnable(); return $this->view; } }
Le www-root/index.php :
switch ($_SERVER['REMOTE_ADDR']) { ... ... default: //online defined('ROOT_APPLICATION') || define('ROOT_APPLICATION', '/var/www/vhosts/maboite.fr/httpdocs/_CLIENTS/monclient/www-root'); defined('ZEND_LIBRARY_PATH') || define('ZEND_LIBRARY_PATH', '/var/www/vhosts/maboite.fr/httpdocs/_LIBRARIES/zend/library'); defined('ZEND_EXTRA_LIBRARY_PATH') || define('ZEND_EXTRA_LIBRARY_PATH', '/var/www/vhosts/maboite.fr/httpdocs/_LIBRARIES/zend/library'); defined('WEB_ROOT') || define('WEB_ROOT', 'http://clients.maboite.fr/monclient/www-root/'); defined('APPLICATION_PATH') || define('APPLICATION_PATH', dirname(__FILE__) . '/../application'); break; } // Define path to application directory defined('APP_LIBRARY_PATH') || define('APP_LIBRARY_PATH', APPLICATION_PATH . '/library'); $paths = array(ZEND_LIBRARY_PATH, ZEND_EXTRA_LIBRARY_PATH, ZEND_DEBUG_LIBRARY_PATH, APP_LIBRARY_PATH, get_include_path());
Une idée ?
Merci
Fabrice
Dernière modification par __fabrice (29-11-2011 12:44:07)
Hors ligne
Salut,
Rajoute dans ton htaccess :
#RewriteRule ^.*$ /monclient/index.php [NC,L]
A+
Hors ligne
Merci, je vais essayer çà.
Fabrice
Hors ligne
Whaou, ça devait être un truc urgent ^^
Hors ligne
çà l'était, et çà ne l'est plus . Mais c'est toujours utile de savoir çà...
Hors ligne
Pages: 1