Yii Framework Forum: Css and Theming - Yii Framework Forum

Jump to content

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

Css and Theming Rate Topic: -----

#1 User is offline   micz 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 31
  • Joined: 05-June 09

Posted 11 February 2010 - 05:34 AM

I have question about theming. How can I set different css files for different themes? I can't find any information how to do this.
0

#2 User is offline   jayrulez 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 348
  • Joined: 29-July 09

Posted 11 February 2010 - 08:49 AM

View Postmicz, on 11 February 2010 - 05:34 AM, said:

I have question about theming. How can I set different css files for different themes? I can't find any information how to do this.


You can put ur css dir/files under the theme folder eg: /themes/themeName/css/style.css and access it using
Yii::app()->theme->baseUrl.'/css/style.css'

php:
foreach(array('cat', 'dog', 'cow') as $animal) echo $animal."\n";

python:
[(animal, print(animal)) for animal in ['cat', 'dog', 'cow']]

ruby:
['cat', 'dog', 'cow'].each {|animal| puts animal}


You say Tomato, I say Tomato.
0

#3 User is offline   micz 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 31
  • Joined: 05-June 09

Posted 11 February 2010 - 09:40 AM

I thought that themes folder is not accessible by users :). Because default views are in protected folder.

Thx for your help.
0

#4 User is offline   andy_s 

  • Random Member Title
  • Yii
  • Group: Moderators
  • Posts: 1,526
  • Joined: 22-June 09
  • Location:Russia, Kostroma

Posted 11 February 2010 - 11:42 AM

View Postmicz, on 11 February 2010 - 09:40 AM, said:

I thought that themes folder is not accessible by users :). Because default views are in protected folder.

Thx for your help.


You can publish these css files with AssetManager or create a subdirectory in webroot/css directory with a theme name and access your css this way: Yii::app()->baseUrl.'/css/'.Yii::app()->theme->name.'/style.css'
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