Class kartik\bs4dropdown\DropdownAsset
DropdownAsset is the asset bundle used in rendering the kartik\bs4dropdown\Dropdown widget.
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
$basePath | string | The Web-accessible directory that contains the asset files in this bundle. | yii\web\AssetBundle |
$baseUrl | string | The base URL for the relative asset files listed in $js and $css. | yii\web\AssetBundle |
$bsColCssPrefixes | array | The bootstrap grid column css prefixes mapping, the key is the bootstrap versions, and the value is an array containing the sizes and their corresponding grid column css prefixes. | kartik\base\BootstrapTrait |
$bsCssMap | array | CSS conversion mappings across bootstrap library versions. | kartik\base\BootstrapTrait |
$bsDependencyEnabled | boolean | Whether to enable the dependency with yii2 bootstrap asset bundle (depending on $bsVersion) | kartik\base\AssetBundle |
$bsExtBasename | integer | The yii2 bootstrap extension base name (readonly property available via getter method getBsExtBasename()) | kartik\base\BootstrapTrait |
$bsPluginEnabled | boolean | Whether the bootstrap JS plugins are to be loaded and enabled | kartik\base\AssetBundle |
$bsVer | integer | Bootstrap version number currently set (readonly property available via getter method getBsVer()) | kartik\base\BootstrapTrait |
$bsVersion | integer|string | The bootstrap library version that you wish to use for this specific extension / widget. | kartik\bs4dropdown\DropdownAsset |
$css | array | List of CSS files that this bundle contains. | yii\web\AssetBundle |
$cssOptions | array | The options that will be passed to yii\web\View::registerCssFile() when registering the CSS files in this bundle. | yii\web\AssetBundle |
$defaultBtnCss | string | Default bootstrap button CSS (readonly property available via getter method getDefaultBtnCss()) | kartik\base\BootstrapTrait |
$defaultIconPrefix | string | Default icon prefix (readonly property available via getter method getDefaultIconPrefix()) | kartik\base\BootstrapTrait |
$depends | array | List of bundle class names that this bundle depends on. | yii\web\AssetBundle |
$dropdownClass | string | Bootstrap dropdown class name based on currently configured bootstrap version (readonly property available via getter method getDropdownClass()) | kartik\base\BootstrapTrait |
$js | array | List of JavaScript files that this bundle contains. | yii\web\AssetBundle |
$jsOptions | array | The options that will be passed to yii\web\View::registerJsFile() when registering the JS files in this bundle. | yii\web\AssetBundle |
$publishOptions | array | The options to be passed to yii\web\AssetManager::publish() when the asset bundle is being published. | yii\web\AssetBundle |
$sourcePath | string|null | The directory that contains the source asset files for this asset bundle. | yii\web\AssetBundle |
Protected Properties
Property | Type | Description | Defined By |
---|---|---|---|
$_bsVer | integer | Current bootstrap version number | kartik\base\BootstrapTrait |
$_defaultBtnCss | string | Default bootstrap button CSS | kartik\base\BootstrapTrait |
$_defaultIconPrefix | string | Default icon CSS prefix | kartik\base\BootstrapTrait |
$_isBs4 | boolean | Flag to detect whether bootstrap 4. | kartik\base\BootstrapTrait |
Public Methods
Method | Description | Defined By |
---|---|---|
__call() | Calls the named method which is not a class method. | yii\base\BaseObject |
__construct() | Constructor. | yii\base\BaseObject |
__get() | Returns the value of an object property. | yii\base\BaseObject |
__isset() | Checks if a property is set, i.e. defined and not null. | yii\base\BaseObject |
__set() | Sets value of an object property. | yii\base\BaseObject |
__unset() | Sets an object property to null. | yii\base\BaseObject |
addCssClass() | Adds bootstrap CSS class to options by parsing the bootstrap version for the specified Bootstrap CSS type. | kartik\base\BootstrapTrait |
addLanguage() | Adds a language JS locale file | kartik\base\BaseAssetBundle |
canGetProperty() | Returns a value indicating whether a property can be read. | yii\base\BaseObject |
canSetProperty() | Returns a value indicating whether a property can be set. | yii\base\BaseObject |
className() | Returns the fully qualified name of this class. | yii\base\BaseObject |
getBSClass() | Gets the respective Bootstrap class based on currently configured bootstrap version. | kartik\base\BootstrapTrait |
getBsVer() | Gets the current set bootstrap version number. | kartik\base\BootstrapTrait |
getCssClass() | Gets bootstrap css class by parsing the bootstrap version for the specified BS CSS type. | kartik\base\BootstrapTrait |
getDefaultBtnCss() | Gets the default button CSS | kartik\base\BootstrapTrait |
getDefaultIconPrefix() | Gets the default icon css prefix | kartik\base\BootstrapTrait |
getDropdownClass() | Gets the respective bootstrap dropdown class name based on currently configured bootstrap version. | kartik\base\BootstrapTrait |
hasMethod() | Returns a value indicating whether a method is defined. | yii\base\BaseObject |
hasProperty() | Returns a value indicating whether a property is defined. | yii\base\BaseObject |
init() | Initializes the bundle. | kartik\bs4dropdown\DropdownAsset |
isBs() | Validate Bootstrap version | kartik\base\BootstrapTrait |
isBs4() | Validate if Bootstrap 4.x version. | kartik\base\BootstrapTrait |
publish() | Publishes the asset bundle if its source code is not under Web-accessible directory. | yii\web\AssetBundle |
register() | Registers this asset bundle with a view. | yii\web\AssetBundle |
registerAssetFiles() | Registers the CSS and JS files with the given view. | yii\web\AssetBundle |
registerBundle() | Registers this asset bundle with a view after validating the bootstrap version | kartik\base\AssetBundle |
removeCssClass() | Removes bootstrap CSS class from options by parsing the bootstrap version for the specified Bootstrap CSS type. | kartik\base\BootstrapTrait |
Protected Methods
Method | Description | Defined By |
---|---|---|
addDependency() | Adds asset bundle dependency | kartik\base\AssetBundle |
configureBsVersion() | Configures the bootstrap version settings | kartik\base\BootstrapTrait |
getBsExtBasename() | The yii2-bootstrap extension base name. | kartik\base\BootstrapTrait |
initBsAssets() | Initialize bootstrap assets dependencies | kartik\base\AssetBundle |
initBsVersion() | Initializes bootstrap versions for the widgets and asset bundles. | kartik\base\BootstrapTrait |
isSameVersion() | Compares two versions and checks if they are of the same major BS version. | kartik\base\BootstrapTrait |
parseVer() | Parses and returns the major BS version | kartik\base\BootstrapTrait |
setSourcePath() | Sets the source path if empty | kartik\base\BaseAssetBundle |
setupAssets() | Set up CSS and JS asset arrays based on the base-file names | kartik\base\BaseAssetBundle |
Constants
Constant | Value | Description | Defined By |
---|---|---|---|
EMPTY_ASSET | 'N0/@$$3T$' | Unique value to set an empty asset via Yii AssetManager configuration. | kartik\base\BaseAssetBundle |
EMPTY_PATH | 'N0/P@T#' | Unique value to set an empty asset file path via Yii AssetManager configuration. | kartik\base\BaseAssetBundle |
KRAJEE_ASSET | 'K3/@$$3T$' | Unique value identifying a Krajee asset | kartik\base\BaseAssetBundle |
KRAJEE_PATH | 'K3/P@T#' | Unique value identifying a Krajee asset file path | kartik\base\BaseAssetBundle |
Property Details
The bootstrap library version that you wish to use for this specific extension / widget.
- To use with bootstrap 3 - you can set this to any string starting with 3 (e.g.
3
or3.3.7
or3.x
) - To use with bootstrap 4 - you can set this to any string starting with 4 (e.g.
4
or4.6.0
or4.x
) - To use with bootstrap 5 - you can set this to any string starting with 5 (e.g.
5
or5.1.0
or5.x
)
This property can be set up globally in Yii application params in your Yii2 application config file.
For example:
'params' = [
'bsVersion' => '5.x' // will enable Bootstrap 5.x globally
]
Note that if this property is set as part of this extension class, then the extension setting will override the
Yii::$app->params['bsVersion']
. This property will default to 3.x
(Bootstrap 3.x version) if it is not
set anywhere (extension or module or Yii params).
Method Details
Initializes the bundle.
If you override this method, make sure you call the parent implementation in the last.
public void init ( ) | ||
throws | yii\base\InvalidConfigException | |
---|---|---|
throws | Exception |