Installation sur site http://client.blabla.fr/monclient/
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 :
Code:
1 2 3 4 5 6 7 8 9
| 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 :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| <?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 :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| <?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 :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| 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