For make button, (*1)
Installation
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
php composer.phar require aki/yii2-make-button "*"
or add, (*4)
"aki/yii2-make-button": "*"
to the require section of your composer.json
file., (*5)
Usage
Once the extension is installed, simply use it in your code by :, (*6)
<?= \aki\button\MakeButton::widget([
'text' => '<i class="fa fa-edit"></i> hello',
]); ?>
also create ajax request
sample :, (*7)
<?= aki\button\MakeButton::widget([
'text' => '<i class="fa fa-edit"></i> hello',
'ajax' => [
'onSendRequest' => 'click',
'url' => Url::toRoute(['post/index']),
'type' => 'POST',
'success' => new yii\web\JsExpression('
function(data){
alert(data);
}
'),
'data' => new yii\web\JsExpression("datafrom('#form')"),
]
]);?>
also diffrent skin exists, (*8)
styles :, (*9)
bootstrap
createive
set skin creative
, (*10)
<?= aki\button\MakeButton::widget([
'text' => '<span>Add to cart</span>',
'skin' => 'creative',
'options' => [
'class' => aki\button\MakeButton::style()->creative->btn3e_send
],
]);?>