use kartik\builder\Form; use kartik\datecontrol\DateControl; use kartik\widgets\FileInput; use kartik\builder\TabularForm; /** * @var yii\web\View $this * @var common\models\ServiceProduct $model * @var yii\widgets\ActiveForm $form */ ?> <div class="service-product-search"> <?php $form = ActiveForm::begin(['type' => ActiveForm::TYPE_HORIZONTAL, 'action' => ['index'], 'method' => 'get']); echo Form::widget(['model' => $model, 'form' => $form, 'columns' => 1, 'attributes' => ['product_id' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => kartik\widgets\Select2::className(), 'options' => ['data' => ArrayHelper::map(common\models\Product::find()->all(), 'id', 'title'), 'options' => ['placeholder' => 'Выбрать...'], 'pluginOptions' => ['allowClear' => true]]], 'service_id' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => kartik\widgets\Select2::className(), 'options' => ['data' => ArrayHelper::map(common\models\Service::find()->all(), 'id', 'title'), 'options' => ['placeholder' => 'Выбрать...'], 'pluginOptions' => ['allowClear' => true]]]]]); ?> <div class="form-group"> <?php echo Html::a(Yii::t('app', 'Reset'), ['index'], ['class' => 'btn btn-default', 'style' => 'margin-left: 15px; margin-right: 10px']); ?> <?php echo Html::submitButton('Search', ['class' => 'btn btn-primary']); ?> </div> <?php ActiveForm::end(); ?> </div>
$menuItems = [['title' => 'Главная', 'url' => ''], ['title' => 'О себе', 'url' => 'about'], ['title' => 'Сертификаты', 'url' => 'sertificate'], ['title' => 'Мои работы', 'url' => 'worck'], ['title' => 'Прайс', 'url' => 'price'], ['title' => 'Статьи', 'url' => 'text'], ['title' => 'Блог', 'url' => 'post'], ['title' => 'Акции', 'url' => 'stock'], ['title' => 'Контакты', 'url' => 'coordinate']]; echo '<ul class="parent0">'; foreach ($menuItems as $p) { if ($p['url'] == 'home') { $p['url'] = '../'; } echo '<li class="lin0"><a href="/' . $p['url'] . '">' . $p['title'] . '</a></li>'; } echo '</ul>'; ?> </div> <table width="100%"> <tr> <td class="right"> <?php $list_serv = common\models\Service::find()->where(['on' => 1])->all(); if (count($list_serv) != 0) { ?> <h2>Услуги:</h2> <div class="menu2"> <ul class="parent0"> <?php foreach ($list_serv as $p) { ?> <li class="lin0"><a href="<?php echo 'http://' . getenv("HTTP_HOST") . '/service/' . $p->id; ?> "><?php echo $p->title; ?> </a></li>