simialbi / yii2-widget-yohours
yii2 widget to create opening_hours data
Installs: 722
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 3
Open Issues: 0
Type:yii2-extension
Requires
- php: >=7.4
- bower-asset/fullcalendar: 4.2.0
- bower-asset/jsmart: ~3.1
- npm-asset/jquery-caret: ~1.3
- npm-asset/jquery-yohours: ^1.1.0
- simialbi/yii2-simialbi-base: >=0.12.0 <1.0 | ^1.0.0
- yiisoft/yii2: ~2.0
Requires (Dev)
- phpunit/phpunit: <7
- yiisoft/yii2-bootstrap5: ^2.0.0
- yiisoft/yii2-coding-standards: ~2.0
Suggests
- yiisoft/yii2-bootstrap: Applies bootstrap 3 styles to input widget
- yiisoft/yii2-bootstrap4: Applies bootstrap 4 styles to input widget
- yiisoft/yii2-bootstrap5: Applies bootstrap 5 styles to input widget
README
This extension integrates an OSM compatible Opening Hours widget into yii2 framework. It's based on Adrien Pavie's YoHours Application.
A live demo is available at projets.pavie.info/yohours.
Resources
- jQuery yohours plugin
- yii2 framework
- bootstrap 3 | 4 | 5
Installation
The preferred way to install this extension is through composer.
Either run
$ php composer.phar require --prefer-dist simialbi/yii2-widget-yohours
or add
"simialbi/yii2-widget-yohours": "*"
to the require
section of your composer.json
Example Usage
To include an yohours input field widget call the widget like this:
<?php /* @var $this yii\web\View */ /* @var $value string */ use simialbi\yii2\yohours\YoHours; ?> <div class="my-form"> <?php echo YoHours::widget([ 'name' => 'opening_hours', 'value' => $value, // 'clientOptions' => [ // 'locale' => 'en', // 'bootstrapVersion' => 'bootstrap4', // 'height' => 600, // 'delay' => 700 // ] ]); // or model like usage /* @var $form \yii\widgets\ActiveForm */ /* @var $model \yii\base\Model */ echo $form->field($model, 'opening_hours')->widget(YoHours::class, [ // 'clientOptions' => [ // 'locale' => 'en', // 'bootstrapVersion' => 'bootstrap4', // 'height' => 600, // 'delay' => 700 // ] ]); ?> </div>
License
yii2-widget-yohours is released under MIT license. See bundled LICENSE for details.