private function findFullName($model, $name)
 {
     if ($model->parent != 0) {
         $parent = CatalogCategorys::findOne($model->parent);
         $name = $this->findFullName($parent, $parent->name . ' > ' . $name);
     }
     return $name;
 }
Example #2
0
 public function getCatalogCategory()
 {
     return $this->hasOne(CatalogCategorys::className(), ['id' => 'category'])->inverseOf('catalogProducts');
 }
Example #3
0
use common\modules\catalog\models\CatalogCategorys;
use common\modules\catalog\models\CatalogProducts;
/* @var $this yii\web\View */
/* @var $model common\modules\content\models\backend */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="admin-form">

    <?php 
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
?>
    <div class="row">
        <div class="col-sm-8">
            <?php 
echo $form->field($model, 'category')->dropDownList(ArrayHelper::map(CatalogCategorys::find()->where(['parent' => '2'])->all(), 'id', 'name'));
?>
            <?php 
echo $form->field($model, 'user_name')->textInput();
?>
            <?php 
echo $form->field($model, 'title')->textInput();
?>
            <?php 
echo $form->field($model, 'description')->textInput();
?>
        </div>
        <div class="col-sm-4">
            <?php 
echo $form->field($model, 'user_phone')->textInput();
?>
Example #4
0
                    <div class="service__image"><img src="<?php 
    echo Url::to('@webuploads/' . str_replace('.jpg', '-thumb-300.jpg', $model->image), true);
    ?>
" alt="" /></div>
                    <div class="service__right">
                        <div class="service__pretitle"><?php 
    echo $model->user_type;
    ?>
</div>
                        <div class="service__title"><?php 
    echo $model->user_name;
    ?>
</div>
                        <div class="service__fields">
                            <div class="service__field"><span class="service__field-portfolio"></span><strong>Сфера деятельности:</strong><?php 
    echo CatalogCategorys::findOne($model->category)->name;
    ?>
</div>
                            <div class="service__field"><span class="service__field-calendar"></span><strong>Опыт работы:</strong> <?php 
    echo $model->description;
    ?>
</div>
                            <div class="service__field"><span class="service__field-phone"></span><strong>Тел:</strong> <?php 
    echo $model->user_phone;
    ?>
</div>
                        </div>
                    </div>
                </div>

                <ul class="nav nav-tabs" role="tablist">