PHP code example of hgh / yii-advance-input
1. Go to this page and download the library: Download hgh/yii-advance-input 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/ */
hgh / yii-advance-input example snippets
echo Text::widget([
"name" => "test-name"
]);
echo Checkbox::widget([
"name" => "test-name"
]);
echo Dropdown::widget([
"name" => "test-name",
"items" => [
"option1" => "value1",
"option2" => "value2"
]
]);
echo Textarea::widget([
"name" => "test-name"
]);
echo Text::widget([
"name" => "test-name"
]);
echo Text::widget([
"name" => "test-name",
"icon" => "fas fa-key"
]);
echo Text::widget([
"name" => "test-name",
"icon" => "fas fa-key",
"unit" => "$"
]);
echo Text::widget([
"name" => "test-name",
"icon" => "fas fa-key",
"unit" => "$",
"checkbox" => true
]);
echo Text::widget([
"name" => "test-name",
"icon" => "fas fa-key",
"unit" => "$",
"checkbox" => true,
"label" => "Price"
]);
echo Text::widget([
"name" => "test-name",
"icon" => "fas fa-key",
"unit" => "$",
"checkbox" => true,
"label" => "Price",
"description" => "How much does it cost?"
]);
echo Text::widget([
"name" => "test-name",
"icon" => "fas fa-key",
"unit" => "$",
"checkbox" => true,
"label" => "Price",
"description" => "How much does it cost?",
"wrapperOptions" => ["style" => "border: 2px dashed red; padding : 10px;"]
]);
echo Text::widget([
"name" => "test-name",
"icon" => "fas fa-key",
"unit" => "$",
"checkbox" => true,
"label" => "Price",
"description" => "How much does it cost?",
"wrapperOptions" => ["style" => "border: 2px dashed red; padding : 10px;"],
"inputOptions" => ["style" => "border: 2px dashed green; background: yellow;"]
]);
echo Text::widget([
"name" => "test-name",
"icon" => "fas fa-key",
"unit" => "$",
"checkbox" => true,
"label" => "Price",
"description" => "How much does it cost?",
"checkboxOptions" => ["data-on" => "enabled", "data-off" => "disabled"]
]);
$form = ActiveForm::begin();
$user = new User();
$user->username = "john.smith";
echo Text::widget([
"name" => "username",
"icon" => "fas fa-user",
"model" => $user,
"form" => $form
]);
echo Text::widget([
"name" => "test-name",
"icon" => "fas fa-key",
"unit" => "$",
"checkbox" => true,
"label" => "Price",
"description" => "How much does it cost?",
"checkboxOptions" => ["data-on" => "enabled", "data-off" => "disabled"],
"rtl" => true
]);
echo Dropdown::widget([
"name" => "test-name",
"icon" => "fas fa-key",
"unit" => "$",
"checkbox" => true,
"label" => "Price",
"description" => "How much does it cost?",
"checkboxOptions" => ["data-on" => "enabled", "data-off" => "disabled"],
"items" => ["option1" => "value1", "option2" => "value2"]
]);