Membuat Tanggal pada Yii2


Hal yang pertama sudah barang tentu kita sudah Download yii2 , dengan cara Manual atau Via Composer. ( Windows + R ) dan pastikan pula Composer sudah terinstal di PC anda, jika belum silakan download here.
Setelah terbuka jendela Comand Prompt anda Copas alamat berikut :
  • To install the basic application template, run the command below:
    php composer.phar create-project yiisoft/yii2-app-basic basic 2.0.9 
    
  • To install the advanced application template, run the command below:
    php composer.phar create-project yiisoft/yii2-app-advanced advanced 2.0.9

Download Manual :
Yii 2 with basic application template
Yii 2 with advanced application template

Tanpa panjang Lebar , saya anggap aja anda sudah membuat web pilihan anda,
di sini saya memakai Extensions 2amigos kartik datePicker
composer require 2amigos/yii2-date-picker-widget:~1.0 
  jika sudah di download ,atur pada view\form.php :
<?php
use dosamigos\datepicker\DatePicker; 
  <?= $form->field($model, 'tgl')->widget(
    DatePicker::className(), [
        // inline too, not bad
         'inline' => false,
         // modify template for custom rendering
        //'template' => '<div class="well well-sm" style="background-color: #fff; width:250px">{input}</div>',
        'clientOptions' => [
            'autoclose' => true,
            'format' => 'yyyy-mm-dd'
        ]
]);?> 
Kurang lebih akan seperti ini tampilan nya..
 Sekian Dulu Tutorial nya semoga bermanpaat salam berbagi.

Comments

Popular posts from this blog

Yii Heart with template

theme yii 2 dengan Ajax