zoukankan      html  css  js  c++  java
  • php传递参数到函数内部

    <?php
    
    use yiihelpersHtml;
    use yiigridGridView;
    
    /* @var $this yiiwebView */
    /* @var $dataProvider yiidataActiveDataProvider */
    
    $this->title = '';
    $this->params['breadcrumbs'][] = $this->title;
    
    $allShopClass = appmodelsShopClass::find()->all();
    ?>
    <div class="sentiment-comment-goods-list-index">
    
        <h1><?= Html::encode($this->title) ?></h1>
    
    
        <?= GridView::widget([
            'dataProvider' => $dataProvider,
            'columns' => [
                ['class' => 'yiigridSerialColumn'],
    
    
                'title',
                'data_id',
                'url:url',
                'shop_id',
                // 'shop_class_id',
                [
                    'attribute' => 'shop_class_id',
                    'value' => function($data) use($allShopClass) {
                        foreach ($allShopClass as $e) {
                            if ($e->id == $data->shop_class_id) {
                                return $e->name;
                            }
                        }
                    },
                ],
    
            ],
        ]); ?>
    </div>
    use($allShopClass)
  • 相关阅读:
    Python with
    Python else
    Python list
    The Python Debugger Pdb
    RPM 包
    yum
    OpenStack I18N
    Python unittest
    MySQL 行格式
    MySQL 行溢出数据
  • 原文地址:https://www.cnblogs.com/luotingliang/p/7306301.html
Copyright © 2011-2022 走看看