Yii Framework Forum: Manual placement of external files - Yii Framework Forum

Jump to content

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

Manual placement of external files javascript, css etc

#1 User is offline   Rodrigo Coelho 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 665
  • Joined: 05-August 10
  • Location:Rio de Janeiro, Brazil

Posted 30 March 2012 - 11:45 AM

Having a widget on the layer template responsible for printing the elements for external files (javascript, css etc) would help to better arrange the position where the elements will be rendered. The manual adjustment will help, for example, with issues related to dependency.
This can be used for inline content, too.

Example code:
<head>
  <?php echo $this->widget('ExternalFiles', array(
    'name'=>'default',
    'type'=>'css',
  )); ?>
</head>

...

  <?php echo $this->widget('ExternalFiles', array(
    'name'=>'bottom',
    'type'=>'js',
  )); ?>
</body>


This would render:

<head>
  <link rel="stylesheet" type="text/css" href="/assets/54867546/style.css" />
</head>

...

  <script type='text/javascript' src='/assets/54867546/common.js'></script>
</body>

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