PHP code example of kartik-v / yii2-widget-activeform
1. Go to this page and download the library: Download kartik-v/yii2-widget-activeform library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kartik-v / yii2-widget-activeform example snippets
// add this in your view
use kartik\form\ActiveForm;
// Vertical Form
$form = ActiveForm::begin([
'id' => 'form-signup',
'type' => ActiveForm::TYPE_VERTICAL
]);
// Inline Form
$form = ActiveForm::begin([
'id' => 'form-login',
'type' => ActiveForm::TYPE_INLINE,
'fieldConfig' => ['autoPlaceholder'=>true]
]);
// Horizontal Form Configuration
$form = ActiveForm::begin([
'id' => 'form-signup',
'type' => ActiveForm::TYPE_HORIZONTAL,
'formConfig' => ['labelSpan' => 3, 'deviceSize' => ActiveForm::SIZE_SMALL]
]);