Installation
此内容尚不支持你的语言。
TimePicker requires PHP 8.3 or later, Yii 2.0.55 or the official 22.0.x-dev framework line, and jQuery. The Composer
package includes the picker JavaScript, CSS and licenses. Load Bootstrap 3, 4, or 5 through the application.
Yii 2.0.55
Section titled “Yii 2.0.55”Configure the asset repository at the application root if it does not already resolve Bower assets.
composer config repositories.asset-packagist composer https://asset-packagist.orgcomposer require yii2-extensions/time-picker:^2.0With Yii 2.0, the widget registers the installed Yii Bootstrap asset adapter for the chosen version. The corresponding
Composer packages are yiisoft/yii2-bootstrap, yiisoft/yii2-bootstrap4, and yiisoft/yii2-bootstrap5.
Yii 22.0 development line
Section titled “Yii 22.0 development line”Require the official yiisoft/yii2:22.0.x-dev at the application root. Point Yii’s @npm alias at the application’s
npm directory. Yii 22 resolves its jQuery asset from @npm/jquery/dist. Install yii2-pjax there if the application
uses Yii’s PJAX widget.
composer require yiisoft/yii2:22.0.x-dev yii2-extensions/time-picker:^2.0npm install jquery@3.7.1 bootstrap@5.3.8# For Yii's PJAX widget:npm install yii2-pjax@2.0.8For Yii 22 client-side ActiveForm validation, install the official jQuery client-script extension and include
yii\jquery\Bootstrap::class in the application’s bootstrap configuration.
composer require yiisoft/yii2-jquery:dev-masterThe Yii Bootstrap 3/4/5 adapter releases that constrain Yii to 2.0 cannot be installed with Yii 22.
Bootstrap version
Section titled “Bootstrap version”Set Yii::$app->params['bsVersion'] to 3.x, 4.x or 5.x; Bootstrap 3 is the default. A widget’s bsVersion
overrides that value for its markup and optional installed asset adapter. Bootstrap 3 uses Glyphicons. Bootstrap 4 and 5
use Font Awesome classes, which this package does not install: load Font Awesome or supply your own addon markup and
upArrowStyle and downArrowStyle classes in pluginOptions.