php - yii framework doesnt use the correct CSS -


i'm working yii framework have installed yii booster extensions , work vagrant. friend works on project, problem application doesn't use correct css. instead, uses css saved in cache.

here how is: there folder at: www\svn\wwwroot\public\assets contains folders weird names, 1 of them contains bootstrap css , belonging bootstrap. wrong because art regenerated every-time regenerate vagrant. problem using correct css unless (delete cookie cash) correct css wrong css, other people using wrong css, unless change them manually on assests folder, totally wrong because every time update workstation using svn should apply new lay out other prople doesn't work.

here main config:

<?php  /**  * main web application configuration.  *  * writable cwebapplication properties can configured here.  * constructed following way:  *    main.php = return main settings  *                  unless overwritten local main settings if available  *                  unless overwritten test settings if available  *                  unless overwritten local test settings if available  * (mergearray: latter overwrite former, see http://www.yiiframework.com/doc/api/1.1/cmap#mergearray-detail)  *  * @author yii, adapted robbert <paulussen@momentum-technologies.nl>  * @since release 1.0 (sprint 1)  */ // set path variables reflect directory structure // $webhome/                     -- doepath // = wwwroot // $webhome/public/              -- webrootpath // $webhome/private/protected/   -- protectedpath // $webhome/private/runtime/     -- runtimepath  $pathtodoedirectory  = realpath(dirname(__file__) . '/../../..'); // = wwwroot $privatepath         = $pathtodoedirectory . '/private/'; $protectedpath       = $pathtodoedirectory . '/private/protected/'; $runtimepath         = $pathtodoedirectory . '/private/runtime/'; $publicpath          = $pathtodoedirectory . '/public/'; $webrootpath         = $publicpath; $vendorpath          = '/vagrant/vendor/';  /**  * namespace mte  */ yii::setpathofalias('mte', $protectedpath);  // used themeurl of widgetfactory settings, in case doe in subdirectory $baseurl = (isset($_server['document_root'])) ? str_replace($_server['document_root'], '', realpath('.')) : '';  //define('eol','<br/>'); //echo '$pathtoccsdirectory = ' . $pathtoccsdirectory . php_eol; //echo '$privatepath = ' . $privatepath . php_eol; //echo '$protectedpath = ' . $protectedpath . php_eol; //echo '$runtimepath = ' . $runtimepath . php_eol; //echo '$publicpath = ' . $publicpath . php_eol; //echo '$webrootpath = ' . $webrootpath . php_eol; /** following defines path aliases using:   yii::setpathofalias('local','path/to/local-folder');  * usage e.g.  ... yii::getpathofalias('runtimepath') ...  */ yii::setpathofalias('doepath', $pathtodoedirectory); yii::setpathofalias('privatepath', $privatepath); yii::setpathofalias('publicpath', $publicpath); yii::setpathofalias('protectedpath', $protectedpath); yii::setpathofalias('runtimepath', $runtimepath); yii::setpathofalias('webrootpath', $webrootpath); yii::setpathofalias('vendorpath', $vendorpath); yii::setpathofalias('booster', $vendorpath . 'clevertech/yii-booster/src/'); // twitter bootstrap library //yii::setpathofalias('booster', $publicpath . 'css/yii-booster/src/'); // twitter bootstrap library  $config_database = require(dirname(__file__) . '/database.php');  $config_main = array(     'sourcelanguage' => 'en', // i18n     'timezone'       => 'europe/amsterdam',     'basepath'       => $protectedpath,     // override default of yii     'runtimepath'    => $runtimepath,     'name'           => yii::t('systemwide', 'doen - dossier opvolg- en actiesysteem'),     //'theme'=>'bootstrap',     'preload'        => array(         'log',         'translate', // i18n         'booster', //yii-booster, twitter bootstrap library     ),     'behaviors' => array(         'onbeginrequest' => array(             'class'  => 'application.components.modulesloader',),     ), // i18n     // autoloading model , component classes, note importing directory not import of subdirectories!     'import' => array(         'application.components.*',         'application.models.*',         'application.modules.rights.*',         'application.modules.rights.components.*',         'application.modules.translate.translatemodule',         'booster.helpers.tbhtml',         'booster.helpers.tbarray',         'booster.behaviors.tbwidget',         'booster.widgets.*'     ),     'modules' => array(         'rights' => array(             'install'        => false, // whether install rights.             'usernamecolumn' => 'login', // name of user name column in database.             'userclass'      => 'rightsmoduleuser', // extended user model             'cssfile'        => '/mte/modules/rights/default.css', // custom css rights module             'superusername'  => 'mteadmin', // doe_user.login of user super user privileges. default 'admin'         /* more options */ //          'applayout'          => 'application.views.layouts.main', // application layout. //          'authenticatedname'  => 'authenticated',                // name of authenticated user role. //          'baseurl'            => '/rights',                      // base url rights. change if module nested. //          'debug'              => false,                          // whether enable debug mode. //          'displaydescription' => true,                           // whether use item description instead of name. //          'enablebizrule'      => true,                           // whether enable authorization item business rules. //          'enablebizruledata'  => false,                          // whether enable data business rules. //          'flasherrorkey'      => 'rightserror',                  // key use setting error flash messages. //          'flashsuccesskey'    => 'rightssuccess',                // key use setting success flash messages. //          'layout'             => 'rights.views.layouts.main',    // layout use displaying rights. //          'useridcolumn'       => 'id',                           // name of user id column in database.         ),         'translate',         'components'     => array(             //use component store cookies             'cookies' => array(                 'class'      => 'application.components.cookieshelper'             ),             // uncomment following enable urls in path-format             'urlmanager' => array(                 'urlformat'      => 'path',                 'showscriptname' => false,                 'rules'          => array(                     '<controller:\w+>/<id:\d+>'              => '<controller>/view',                     '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',                     '<controller:\w+>/<action:\w+>'          => '<controller>/<action>',                 ),             ),             'errorhandler'                           => array(                 // use 'site/error' action display errors                 'erroraction'    => 'site/error',             ),             'log'            => array(                 'class'  => 'clogrouter',                 'routes' => array(                     array(                         'class'      => 'cfilelogroute',                         'levels'     => 'info, warning, error',                     ),                 ),             ),         ),     ),     // application components     'components' => array(         // class used simplify template actions         'templatehelper' => array(             'class'      => 'application.components.templatehelper',         ),         /* i18n - begin */         'messages'   => array(             'class'                  => 'cdbmessagesource',             'onmissingtranslation'   => array('translatemodule',                 'missingtranslation',             ),         ),         'translate' => array(             'class'              => 'translate.components.mptranslate',             'acceptedlanguages'  => array(                 'en'             => 'english',                 'nl'             => 'nederlands',             ),         ),         /* i18n - end */         'authmanager'    => array(             'class'          => 'rdbauthmanager',             'connectionid'   => 'db',             'defaultroles'   => array('authenticated', 'user'),         ),         'user' => array(             'class'          => 'webuser',             /* enable cookie-based authentication */             'allowautologin' => true,             /* @see http://www.yiiframework.com/doc/guide/1.1/en/topics.auth */             'loginurl'       => array('/site/login'),         ),         'booster' => array(             'class'          => 'booster.components.bootstrap',             'corecss'        => true,             'responsivecss'  => true,             'yiicss'         => true,             'minify'         => true,         ),     ),     /** application-level parameters can accessed      *  using yii::app()->params['paramname']      */     'params'         => array(         // used in contact page         'adminemail'         => 'beheer@momentum-technologies.nl',         'cookie_duration'    => 3600 * 24 * 30,         'composer.callbacks' => array(             // args yii command runner             'yiisoft/yii-install' => array('yiic', 'webapp', dirname(__file__) . directory_separator . '..' . directory_separator . '..'),             'post-update' => array('yiic', 'migrate'),             'post-install' => array('yiic', 'migrate'),         ),     ), ); $maindbincluded = cmap::mergearray($config_database, $config_main);  // include , merge local main config if exists if (file_exists(dirname(__file__) . '/main-local.php')) {     return cmap::mergearray($maindbincluded, include(dirname(__file__) . '/main-local.php')); } // otherwise load main config file return $maindbincluded; 

as can see have defined css path be:

yii::setpathofalias('booster', $vendorpath . 'clevertech/yii-booster/src/'); // twitter bootstrap library 

here header.php goe wrong:

<?php $lang = yii::app()->getlanguage(); if (empty($lang)) {     $lang = 'en'; } ?> <!doctype html> <html lang="<?php echo $lang; ?>">     <head>         <meta http-equiv="content-type" content="text/html; charset=utf-8" />         <link rel="stylesheet" type="text/css" href="<?php echo yii::app()->request->baseurl; ?>/css/screen.css" media="screen, projection" />         <link rel="stylesheet" type="text/css" href="<?php echo yii::app()->request->baseurl; ?>/css/main.css" />         <link rel="stylesheet" type="text/css" href="<?php echo yii::app()->request->baseurl; ?>/css/widgets/jui.tabs.css" />         <link rel="stylesheet" type="text/css" href="<?php echo yii::app()->baseurl; ?>/css/common.css" />         <?php         yii::app()->clientscript->registercorescript('jquery');         yii::app()->clientscript->registerscriptfile(yii::app()->baseurl . '/js/common.js');         ?>         <title><?php echo chtml::encode($this->pagetitle); ?></title>         <link rel="stylesheet" type="text/css" href="<?php echo yii::app()->request->baseurl; ?>/css/widgets/jui.tabs.css" />     </head>     <body>          <div id="header">             <?php             $this->widget('booster.widgets.tbnavbar', array(             'brand' => '<img src="' . yii::app()->request->baseurl . '/images/logo_mte.png" alt="" />' ,             'brandurl' => '#',             'collapse' => true,             'type' => null,             'items' => array(                 'brand' =>  yii::app()->name ,                 array(                     'class' => 'booster.widgets.tbmenu',                     'items' => array(                         array('label'    => 'login', 'url'   => array('/site/login'), 'visible' => yii::app()->user->isguest),                         array('label'    => 'logout (' . yii::app()->user->name . ')', 'url'     => array('/site/logout'), 'visible' => !yii::app()->user->isguest)                     ),                 ),             )));             ?>         </div>          <div id="ajaxloading">             <!--<img src="../public/images/ajax-loader.gif" alt="loading..."/>-->         </div> 

an when @ inspect element in chrome see:

as can see generated in assets. dont want how can fix that?

but doesn't use 1 , instead, uses incorrect version. can me out this? maybe getting wrong , problem else. thanks

i experienced many css issues when working booster extension before, re-installing following steps fixed them me @ time:

  1. get yiiboilerplate , unzip somewhere, it's created same guys @ clevertech , using booster extension default.
  2. go {unzipped}backend/views/layouts/ , grab main.php, column1.php , column2.php
  3. create new theme in webapp under /themes folder (i called 'booster')
  4. copy 3 files (3) themes/booster/views/layouts in main.php add 'theme' => 'booster' top-level entry of array (i put first)

that @teachert solution worked out me after posting this stackoverflow question, other solutions has came out later , seemed solve css issues other users, may try them too.


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -