Yii Framework Forum: asset manager - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

asset manager

#1 User is offline   Cihan Ozturk 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 39
  • Joined: 02-June 10
  • Location:İstanbul

Posted 22 December 2010 - 05:29 AM

merhaba


küçük bir sorunum var

site ana config.php de aşağıdaki gibi ayarları yaptım istediğim gibide oldu,
'clientScript' => array(
     //'coreScriptPosition' => 0,
     //'coreScriptUrl' => 'webroot.themes.javascript',
         'scriptMap' => array(
                '*.js' => false,
                '*.css' => false,
            )
  ),



ama module admin modulünde js ve css lerin yüklenmesini istiyorum

ama bir türlü tam istediğim gibi olması
class AdminModule extends CWebModule {
    function init(){
       $as=Yii::app()->assetManager;
       $as->setBasePath('themes/assets');
        
       $cs=Yii::app()->clientScript;
       $cs->reset();
       $cs->coreScriptUrl=Yii::app()->createUrl("/themes/assest") ;
	   $cs->scriptMap=array(
		    
		);
       
    }
}



sonuç scriptleri ekliyor ama aşağıdaki gibi oluyor.

   <script type="text/javascript" src="/site/assets/27593dbd/jquery.validate.js"></script>



themes/assets şeklinde olması gerekiyor

nasıl yaparım
0

#2 User is offline   Umut Gundogdu 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 103
  • Joined: 27-November 08
  • Location:Ankara

Posted 22 December 2010 - 05:41 PM

setBasePath yerine setBaseUrl li kullanirsan calisacaktir.
Yii::app()->assetManager->setBaseUrl($this->createUrl("themes/assest"));


setbasepath i kullanmak icin realpath i alman gerekiyor.
0

#3 User is offline   Cihan Ozturk 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 39
  • Joined: 02-June 10
  • Location:İstanbul

Posted 25 December 2010 - 12:50 PM

View Postumutau, on 22 December 2010 - 05:41 PM, said:

setBasePath yerine setBaseUrl li kullanirsan calisacaktir.
Yii::app()->assetManager->setBaseUrl($this->createUrl("themes/assest"));


setbasepath i kullanmak icin realpath i alman gerekiyor.



teşekküler işe yaradı
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users