Précédent   Forum des professionnels en informatique > PHP > Outils > Zend > Zend Framework
Zend Framework Forum d'entraide sur la programmation PHP avec Zend Framework. Avant de poster -> FAQ ZF, Cours ZF
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 29/11/2011, 12h42   #1
Membre actif
 
Avatar de __fabrice
 
Fabrice
Inscription : août 2004
Messages : 308
Détails du profil
Informations personnelles :
Nom : Fabrice
Âge : 40

Informations forums :
Inscription : août 2004
Messages : 308
Points : 180
Points : 180
Envoyer un message via ICQ à __fabrice Envoyer un message via MSN à __fabrice
Par défaut 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
__fabrice est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 29/11/2011, 19h55   #2
Modérateur
 
Homme Loïc
Développeur Web
Inscription : février 2011
Messages : 680
Détails du profil
Informations personnelles :
Nom : Homme Loïc
Âge : 26
Localisation : France, Hérault (Languedoc Roussillon)

Informations professionnelles :
Activité : Développeur Web
Secteur : High Tech - Multimédia et Internet

Informations forums :
Inscription : février 2011
Messages : 680
Points : 1 044
Points : 1 044
Bonsoir,
Tu peux nous faire voir le code source généré? Et as tu essayé d utiliser baseUrl() pour le chargement du css?
5h4rk est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 00h25.


 
 
 
 
Partenaires

Hébergement Web