getCategoryPairs() public static method

public static getCategoryPairs ( )
Example #1
0
<a class="storeinfo-edit" href="<?php 
echo Url::to(['/school/' . Yii::$app->params['schoolModel']->id]);
?>
" title="切换营业点">[切换]</a></h2>
            <div class="storeinfo-content">
                <ul class="nav nav-pills nav-orange nav-justified">
                    <li role="presentation" class="active"><a href="#tab-content-0" data-toggle="tab" aria-expanded="true">商品分类</a></li>
                    <li role="presentation"><a href="#tab-content-1" data-toggle="tab" aria-expanded="false">店铺详情</a></li>
                </ul>
                <div class="tab-content">
                    <div id="tab-content-0" class="tab-pane active">
                        <table class="table">
                            <tbody>
                                <tr>
                                    <?php 
foreach (Category::getCategoryPairs() as $slug => $name) {
    ?>
                                    <td><a href="<?php 
    echo Url::to(['/store/index', 'id' => $model->id, 'category' => $slug]);
    ?>
" class="link-cate" data-target="#cate-<?php 
    echo $slug;
    ?>
"><?php 
    echo Html::img($this->theme->getUrl('images/category/' . $slug . '.png'));
    echo $name;
    ?>
</a></td>
                                    <?php 
}
?>