Beispiel #1
0
</h2>

    <!--NAME-->
    <?php 
echo $form->field($products_translation, 'title', ['inputOptions' => ['class' => 'form-control']])->label(\Yii::t('shop', 'Name'));
?>

    <div class="row">
        <!--CATEGORY-->
        <div class="col-md-6">
            <b><?php 
echo \Yii::t('shop', 'Category');
?>
</b>
            <?php 
echo InputTree::widget(['className' => Category::className(), 'form' => $form, 'model' => $product, 'attribute' => 'category_id', 'languageId' => $selectedLanguage->id]);
?>
        </div>
        <div class="col-md-6">
            <div>
                <!--ARTICULUS-->
                <?php 
echo $form->field($product, 'articulus', ['inputOptions' => ['class' => 'form-control']])->label(\Yii::t('shop', 'Articulus'));
?>
            </div>
            <div>
                <!--STANDART PRICE-->
                <?php 
echo $form->field($product, 'price', ['inputOptions' => ['class' => 'form-control']])->textInput(['type' => 'number', 'step' => '0.01'])->label(\Yii::t('shop', 'Price'));
?>
            </div>
Beispiel #2
0
 * @var $parents \yii\db\ActiveRecord
 *
 * @var $form \yii\widgets\ActiveForm
 * @var $model \yii\base\Model
 * @var $attribute string
 * @var $languageId integer
 */
use yii\bootstrap\Html;
?>

<ul class="input-tree-ul">
    <?php 
foreach ($parents as $object) {
    ?>
        <?php 
    $children = \bl\cms\shop\widgets\InputTree::findChildren($object, $object->id);
    ?>
        <li>
            <?php 
    echo !empty($children) ? Html::tag('p', '', ['class' => 'category-toggle fa fa-plus']) : '';
    ?>
            <?php 
    echo $form->field($model, $attribute, ['template' => "{input}\n{label}"])->input('radio', [$object->id == $model->{$attribute} ? 'checked' : '' => $object->id == $model->{$attribute} ? 'checked' : '', get_class($object) == get_class($model) && $object->id == $model->id ? 'disabled' : '' => true, 'value' => $object->id, 'class' => 'radio', 'id' => $model::className() . '-category_id-' . $object->id])->label($object->translations[$languageId]->title ?? $object->translation->title, ['for' => $model::className() . '-category_id-' . $object->id]);
    ?>

            <?php 
    echo $this->render('@vendor/black-lamp/blcms-shop/widgets/views/input-tree/ul', ['parents' => $children, 'form' => $form, 'model' => $model, 'attribute' => $attribute, 'languageId' => $languageId]);
    ?>
        </li>
    <?php 
}