Skip to content

Commit

Permalink
add notes to View register JS and CSS file methods
Browse files Browse the repository at this point in the history
explain why assetmanager features are not available in these methods.

close #14382
related to #10297, #9101
  • Loading branch information
cebe committed Jul 4, 2017
1 parent 4da0581 commit 13d35c4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions framework/web/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,11 @@ public function registerCss($css, $options = [], $key = null)

/**
* Registers a CSS file.
*
* This method should be used for simple registration of CSS files. If you want to use features of
* [[AssetManager]] like appending timestamps to the URL and file publishing options, use [[AssetBundle]]
* and [[registerAssetBundle()]] instead.
*
* @param string $url the CSS file to be registered.
* @param array $options the HTML attributes for the link tag. Please refer to [[Html::cssFile()]] for
* the supported options. The following options are specially handled and are not treated as HTML attributes:
Expand Down Expand Up @@ -446,6 +451,11 @@ public function registerJs($js, $position = self::POS_READY, $key = null)

/**
* Registers a JS file.
*
* This method should be used for simple registration of JS files. If you want to use features of
* [[AssetManager]] like appending timestamps to the URL and file publishing options, use [[AssetBundle]]
* and [[registerAssetBundle()]] instead.
*
* @param string $url the JS file to be registered.
* @param array $options the HTML attributes for the script tag. The following options are specially handled
* and are not treated as HTML attributes:
Expand Down

0 comments on commit 13d35c4

Please sign in to comment.