gertexllc / yii2-bootstrap-detector
A Yii2 component to detect the used Bootstrap version and return it.
Requires
- php: >=7.1
- ext-json: *
- yidas/yii2-bower-asset: 2.0.13.1
- yiisoft/yii2: ^2.0
This package is auto-updated.
Last update: 2025-03-28 20:11:52 UTC
README
A Yii2 component to detect the used Bootstrap version and return it.
Installation
You can install this component via Composer by running the following command:
composer require gertexllc/yii2-bootstrap-detector
Usage
To use the Bootstrap detector, simply create a new instance of the BootstrapDetector
class and call the detectVersionNumber()
or detectMajorVersion()
methods:
use gertexllc\yii2bootstrapdetector\BootstrapDetector; // Detect the full version number $detector = new BootstrapDetector(); $version = $detector->detectVersionNumber(); // e.g. "4.6.0" // Detect the major version number only $detector = new BootstrapDetector(); $majorVersion = $detector->detectMajorVersion(); // e.g. "4"
The detectVersionNumber()
method returns the full version number of the detected Bootstrap version, or null
if no version is detected. The detectMajorVersion()
method returns only the major version number of the detected Bootstrap version, or null
if no version is detected.
Requirements
This component requires Yii2 and the Bootstrap asset bundles used by your Yii2 application.
License
This component is released under the MIT License. See the LICENSE file for details.
Author
The BootstrapDetector
was developed and brought to you free of charge by GerTex, LLC