Пример #1
0
 /**
  * Lists all Taxonomy models.
  * @return mixed
  */
 public function actionIndex($category)
 {
     $searchModel = new TaxonomySearch();
     $dataProvider = new ArrayDataProvider();
     $dataProvider->allModels = Taxonomy::getArrayTree($category);
     $dataProvider->key = 'id';
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
Пример #2
0
 public function getTaxonomiesAsTree($category)
 {
     return Taxonomy::getArrayTree($category);
 }
Пример #3
0
<?php

use yii\helpers\Html;
use source\modules\taxonomy\models\Taxonomy;
use source\helpers\StringHelper;
use source\libs\Common;
use source\core\widgets\ActiveForm;
use source\libs\TreeHelper;
/* @var $this yii\web\View */
/* @var $model app\models\Taxonomy */
/* @var $form yii\widgets\ActiveForm */
$category = $model->category_id;
$taxonomies = Taxonomy::getArrayTree($category);
$options = TreeHelper::buildTreeOptionsForSelf($taxonomies, $model);
?>

<?php 
$this->toolbars([Html::a('返回', ['index', 'category' => $category], ['class' => 'btn btn-xs btn-primary mod-site-save'])]);
?>


    <?php 
$form = ActiveForm::begin();
?>

<div class="da-ex-tabs">
    <ul>
        <li><a href="#tabs-info">基本信息</a></li>
        <li><a href="#tabs-seo">模板设置</a></li>
        <li><a href="#tabs-template">SEO设置</a></li>
    </ul>
Пример #4
0
<?php

use yii\web\View;
use yii\helpers\Html;
use yii\helpers\Url;
use source\libs\Resource;
use source\models\Content;
use source\modules\taxonomy\models\Taxonomy;
use source\LuLu;
/* @var $this yii\web\View */
if (isset($taxonomyId)) {
    $moduleId = LuLu::$app->controller->module->id;
    $taxonomies = Taxonomy::getArrayTree($this->getConfigValue($taxonomyId));
    ?>

<div class="widget d_postlist">
    <div class="title">
        <h2>分类</h2>
    </div>
    <ul>
        <li><?php 
    echo Html::a('所有', ['/' . $moduleId . '/default/list']);
    ?>
</li>
        <?php 
    foreach ($taxonomies as $taxonomy) {
        ?>
        <li><?php 
        echo Html::a($taxonomy['name'], ['/' . $moduleId . '/default/list', 'taxonomy' => $taxonomy['id']]);
        ?>
</li>