AssetBundle

Type
Class
Namespace
craft\web
Inherits
craft\web\AssetBundle » yii\web\AssetBundle (opens new window) » yii\base\BaseObject (opens new window)
Implements
yii\base\Configurable (opens new window)
Extended by
craft\web\assets\admintable\AdminTableAsset, craft\web\assets\assetindexes\AssetIndexesAsset, craft\web\assets\axios\AxiosAsset, craft\web\assets\clearcaches\ClearCachesAsset, craft\web\assets\cp\CpAsset, craft\web\assets\craftsupport\CraftSupportAsset, craft\web\assets\d3\D3Asset, craft\web\assets\dashboard\DashboardAsset, craft\web\assets\datepickeri18n\DatepickerI18nAsset, craft\web\assets\dbbackup\DbBackupAsset, craft\web\assets\deprecationerrors\DeprecationErrorsAsset, craft\web\assets\editentry\EditEntryAsset, craft\web\assets\editsection\EditSectionAsset, craft\web\assets\edittransform\EditTransformAsset, craft\web\assets\edituser\EditUserAsset, craft\web\assets\elementresizedetector\ElementResizeDetectorAsset, craft\web\assets\fabric\FabricAsset, craft\web\assets\feed\FeedAsset, craft\web\assets\fields\FieldsAsset, craft\web\assets\fieldsettings\FieldSettingsAsset, craft\web\assets\fileupload\FileUploadAsset, craft\web\assets\findreplace\FindReplaceAsset, craft\web\assets\garnish\GarnishAsset, craft\web\assets\generalsettings\GeneralSettingsAsset, craft\web\assets\graphiql\GraphiqlAsset, craft\web\assets\graphiql\VendorAsset, craft\web\assets\iframeresizer\ContentWindowAsset, craft\web\assets\iframeresizer\IframeResizerAsset, craft\web\assets\installer\InstallerAsset, craft\web\assets\jquerypayment\JqueryPaymentAsset, craft\web\assets\jquerytouchevents\JqueryTouchEventsAsset, craft\web\assets\jqueryui\JqueryUiAsset, craft\web\assets\login\LoginAsset, craft\web\assets\matrix\MatrixAsset, craft\web\assets\matrixsettings\MatrixSettingsAsset, craft\web\assets\newusers\NewUsersAsset, craft\web\assets\picturefill\PicturefillAsset, craft\web\assets\plugins\PluginsAsset, craft\web\assets\pluginstore\PluginStoreAsset, craft\web\assets\pluginstoreoauth\PluginStoreOauthAsset, craft\web\assets\positionselect\PositionSelectAsset, craft\web\assets\prismjs\PrismJsAsset, craft\web\assets\queuemanager\QueueManagerAsset, craft\web\assets\quickpost\QuickPostAsset, craft\web\assets\qunit\QunitAsset, craft\web\assets\recententries\RecentEntriesAsset, craft\web\assets\routes\RoutesAsset, craft\web\assets\selectize\SelectizeAsset, craft\web\assets\sites\SitesAsset, craft\web\assets\systemmessages\SystemMessagesAsset, craft\web\assets\tablesettings\TableSettingsAsset, craft\web\assets\tests\TestsAsset, craft\web\assets\timepicker\TimepickerAsset, craft\web\assets\updater\UpdaterAsset, craft\web\assets\updates\UpdatesAsset, craft\web\assets\updateswidget\UpdatesWidgetAsset, craft\web\assets\userpermissions\UserPermissionsAsset, craft\web\assets\utilities\UtilitiesAsset, craft\web\assets\velocity\VelocityAsset, craft\web\assets\vue\VueAsset, craft\web\assets\xregexp\XregexpAsset

View source (opens new window)

# Public Properties

Property Description
basePath (opens new window) string (opens new window) – The Web-accessible directory that contains the asset files in this bundle.
baseUrl (opens new window) string (opens new window) – The base URL for the relative asset files listed in js (opens new window) and css (opens new window).
css (opens new window) array (opens new window) – List of CSS files that this bundle contains.
cssOptions (opens new window) array (opens new window) – The options that will be passed to yii\web\View::registerCssFile() (opens new window) when registering the CSS files in this bundle.
depends (opens new window) array (opens new window) – List of bundle class names that this bundle depends on.
js (opens new window) array (opens new window) – List of JavaScript files that this bundle contains.
jsOptions (opens new window) array (opens new window) – The options that will be passed to yii\web\View::registerJsFile() (opens new window) when registering the JS files in this bundle.
publishOptions (opens new window) array (opens new window) – The options to be passed to yii\web\AssetManager::publish() (opens new window) when the asset bundle is being published.
sourcePath (opens new window) string (opens new window) – The directory that contains the source asset files for this asset bundle.

# Public Methods

Method Description
__call() (opens new window) Calls the named method which is not a class method.
__construct() (opens new window) Constructor.
__get() (opens new window) Returns the value of an object property.
__isset() (opens new window) Checks if a property is set, i.e. defined and not null.
__set() (opens new window) Sets value of an object property.
__unset() (opens new window) Sets an object property to null.
canGetProperty() (opens new window) Returns a value indicating whether a property can be read.
canSetProperty() (opens new window) Returns a value indicating whether a property can be set.
className() (opens new window) Returns the fully qualified name of this class.
hasMethod() (opens new window) Returns a value indicating whether a method is defined.
hasProperty() (opens new window) Returns a value indicating whether a property is defined.
init() (opens new window) Initializes the object.
publish() (opens new window) Publishes the asset bundle if its source code is not under Web-accessible directory.
register() (opens new window) Registers this asset bundle with a view.
registerAssetFiles() (opens new window) Registers the CSS and JS files with the given view.

# Protected Methods

Method Description
dotJs() Returns '.min.js' if Craft is configured to serve compressed JavaScript files, otherwise '.js'.
useCompressedJs() Returns whether Craft is configured to serve compressed JavaScript files

# dotJs()

DEPRECATED

Deprecated in 3.5.0

Returns '.min.js' if Craft is configured to serve compressed JavaScript files, otherwise '.js'.

View source (opens new window)

Returns

string (opens new window)

# useCompressedJs()

DEPRECATED

Deprecated in 3.5.0

Returns whether Craft is configured to serve compressed JavaScript files

View source (opens new window)

Returns

boolean (opens new window)