Beispiel #1
0
<?php

/**
 * @var Category $node
 * @var ActiveForm $form
 */
use app\models\Category;
use app\modules\file\ImageSelector;
use kartik\form\ActiveForm;
use yii\bootstrap\Html;
use yii\helpers\Url;
use yii\redactor\widgets\Redactor;
echo $form->field($node, 'slug')->textInput(['readonly' => true]);
echo $form->field($node, 'image')->widget(ImageSelector::className());
echo $form->field($node, 'status')->dropDownList([Yii::t('app', 'No'), Yii::t('app', 'Yes')]);
echo $form->field($node, 'announce')->widget(Redactor::className());
if ($node->isLeaf() && !$node->isNewRecord) {
    echo Html::a(Yii::t('app', 'View products'), Url::to(['/admin/product/list', 'node' => $node->id]), ['class' => 'btn btn-success']);
}
Beispiel #2
0
 * @var View $this
 * @var Product $model
 */
?>

<div class="product-form">
    <?php 
$form = ActiveForm::begin();
?>

    <?php 
echo $form->field($model, 'name');
?>

    <?php 
echo $form->field($model, 'images')->widget(ImageSelector::className());
?>

    <?php 
echo $form->field($model, 'category_id')->widget(EntityDropDown::className(), array('items' => ArrayHelper::map(Category::find()->leaves()->all(), 'id', 'name')));
?>

    <?php 
echo $form->field($model, 'old_price');
?>

    <?php 
echo $form->field($model, 'price');
?>

    <?php