Yii Framework Forum: Css Sequence in 'bootstrap' extension - Yii Framework Forum

Jump to content

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

Css Sequence in 'bootstrap' extension Rate Topic: -----

#1 User is offline   Mohit 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 34
  • Joined: 06-July 11

Posted 16 January 2012 - 07:15 AM

I am trying to implement the Bootstrap CSS throughout the webapp.

So, i hv changed the main.php layout to remove all the link statements of the Blueprint CSS framework and just keep the Bootstrap CSS link threw the following line (as mentioned in the extension):

<?php echo Yii::app()->bootstrap->registerCoreCss(); ?>


And then i have custom css files for each page, being loaded in the individual view files after the pageTitle statement.

But no matter where i place the registerCoreCss statement in main.php, the bootstrap css file is getting loaded only after the custom css file. I know it can be done by setting the above statement in the controller init() function or maybe in the module init() function.

But is there a way of setting it in the main.php file, so that it need not be set for every controller or module?
0

#2 User is offline   arunj 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 30-January 12

Posted 02 February 2012 - 05:27 PM

View PostMohit, on 16 January 2012 - 07:15 AM, said:

I am trying to implement the Bootstrap CSS throughout the webapp.

So, i hv changed the main.php layout to remove all the link statements of the Blueprint CSS framework and just keep the Bootstrap CSS link threw the following line (as mentioned in the extension):

<?php echo Yii::app()->bootstrap->registerCoreCss(); ?>


And then i have custom css files for each page, being loaded in the individual view files after the pageTitle statement.

But no matter where i place the registerCoreCss statement in main.php, the bootstrap css file is getting loaded only after the custom css file. I know it can be done by setting the above statement in the controller init() function or maybe in the module init() function.

But is there a way of setting it in the main.php file, so that it need not be set for every controller or module?



Try giving the css code
<?php echo Yii::app()->bootstrap->registerCoreCss(); ?>

before the
<title>......</title>

and give your coustom css after the
<title>......</title>


in the "protected/views/layout/main.php" file
0

#3 User is offline   delphaber 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 02-January 13

Posted 02 January 2013 - 06:44 AM

Works! Thx
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