Example #1
0
 public function run()
 {
     echo '<ul class="list-unstyled list-inline">';
     foreach ($this->links as $link) {
         if (!$link->parent) {
             if ($link->child_exist) {
                 echo '<li><h3><a href="category-' . $link->id . '">' . $link->anchor . '</a></h3>';
                 $this->appendChild($this->links, $link) . '</li>';
             } else {
                 echo '<li><h3><a href="category-' . $link->id . '">' . $link->anchor . '</a></h3></li>';
             }
         }
     }
     echo '</ul>';
     $view = $this->view;
     CategoryAsset::register($view);
 }
Example #2
0
 public function run()
 {
     echo Html::activeHiddenInput($this->model, $this->attribute, $this->options);
     $input_id = $this->attribute;
     if ($this->model[$this->attribute]) {
         $label = (new Category())->getAnchorPath($this->model[$this->attribute]);
     } else {
         $label = 'Выберете категорию';
     }
     Modal::begin(['header' => null, 'toggleButton' => ['label' => $label, 'class' => 'btn-link category-link-select', 'id' => 'btn-categories-modal'], 'options' => ['id' => 'categories-modal', 'data-input-id' => strtolower($this->model->formName()) . '-' . $input_id, 'data-categories-id' => $this->pluginOptions['categories_id']]]);
     echo Html::beginTag('div', ['class' => 'category-list', 'id' => 'category-list']);
     //        echo Html::beginTag('ul', ['class' => 'list-inline', 'id' => 'categories-lists']);
     //        echo '<li id="category-list-1"></li>';
     //        echo Html::endTag('ul');
     echo Html::endTag('div');
     Modal::end();
     //echo Html::a('Выберете категорию', null, ['id' => 'category-link-select']);
     $view = $this->view;
     CategoryAsset::register($view);
 }