Giter Site home page Giter Site logo

faryshta / yii2-clockpicker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from madand/yii2-clockpicker

3.0 2.0 3.0 55 KB

Bootstrap and Jquery Yii2 widgets for https://github.com/weareoutman/clockpicker (clock-like time picker) jquery plugin

License: Other

PHP 100.00%

yii2-clockpicker's Introduction

Faryshta Yii2 ClockPicker

Latest Stable Version Total Downloads Latest Unstable Version License

Bootstrap and Jquery Yii2 widgets for clockpicker (clock-like time picker) jquery plugin

Installation

The preferred way to install this extension is through composer.

Either run

composer require --prefer-dist "faryshta/yii2-clockpicker:*"

or add

"faryshta/yii2-clockpicker": "*"

to the require section of your composer.json file.

If you want to use the Bootstrap ClockPicker you need to include the yiisoft/yii2-bootstrap extension

composer require --prefer-dist "yiisoft/yii2-bootstrap:*"

or add

"yiisoft/yii2-bootstrap": "*"

Usage

Jquery

In the view file register the asset:

use farystha\widgets\JqueryClockPicker;


// with ActiveForm
echo $form->field($model, 'attribute')->widget(JqueryClockPicker::className() [
    // extra configuration
]);

// without ActiveForm and with model.
echo JqueryClockPicker::widget([
    'model' => $person,
    'attribute' => 'gender',
]);

Bootstrap

In the view file register the asset:

use farystha\widgets\BootstrapClockPicker;


// with ActiveForm
echo $form->field($model, 'attribute')->widget(BootstrapClockPicker::className() [
    // extra configuration
]);

// without ActiveForm and with model.
echo BootstrapClockPicker::widget([
    'model' => $person,
    'attribute' => 'gender',
]);

Documentation

This library doesn't define anything new, the widgets classes are very similar to the class \yii\bootstrap\Widget which can be used as documentation for the widget classes.

The JS options can be passed using the $clientOptions property and the events can be declared using the $clientEvents property. The documentation on all the options and events supported by clockpicker can be found here.

License

The BSD License (BSD). Please see License File for more information.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.