当前位置: 首页>>代码示例>>PHP>>正文


PHP Column::className方法代码示例

本文整理汇总了PHP中yii\grid\Column::className方法的典型用法代码示例。如果您正苦于以下问题:PHP Column::className方法的具体用法?PHP Column::className怎么用?PHP Column::className使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在yii\grid\Column的用法示例。


在下文中一共展示了Column::className方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: function

                    <?php 
    echo Html::submitButton('Создать автоматом', ['class' => 'btn btn-success']);
    ?>
                </form>
            </div>
        <?php 
}
?>
        <?php 
echo GridView::widget(['dataProvider' => $deviceProvider, 'filterModel' => $searchDeviceModel, 'layout' => "{items}", 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'type_id', 'value' => function ($moddev) use($model) {
    $str = '-';
    if (isset($moddev->type_id)) {
        $str = $moddev->deviceType->title;
        $str .= empty($moddev->deviceType->synonyms) ? '' : ' (' . $moddev->deviceType->synonyms . ')';
    }
    return Html::a($str, ['devices/view', 'id' => $moddev->id, 'id_wp' => $model->id]);
}, 'format' => 'raw'], 'brand', 'model', 'sn', 'id', ['attribute' => 'device_note', 'value' => function ($moddev) use($model) {
    /* @var $moddev \backend\models\Devices */
    return Html::a($moddev->device_note, ['devices/view', 'id' => $moddev->id, 'id_wp' => $model->id]);
}, 'format' => 'raw'], ['class' => Column::className(), 'content' => function ($moddev) use($model) {
    return Html::a(Html::img('/admin/img/view.png', ['style' => 'height:24px']), ['devices/view', 'id' => $moddev->id, 'id_wp' => $model->id], ['title' => 'Подробно...']);
    //['data-method' => 'post']);
}, 'options' => ['style' => 'width:10px']], ['class' => Column::className(), 'content' => function ($moddev) use($model) {
    return Html::a('', ['devices/delfromwp', 'id' => $moddev->id, 'id_wp' => $model->id], ['class' => 'cross', 'title' => 'Удалить устройство с рабочего места...']);
    //['data-method' => 'post']);
}, 'options' => ['style' => 'width:10px']]]]);
?>

    </div>
</div>
开发者ID:Griff19,项目名称:it_base,代码行数:30,代码来源:view.php

示例2: function

    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <p>
        <?php 
echo Html::a('Создать номер', ['create'], ['class' => 'btn btn-success']);
?>
        <?php 
echo Html::a('Загрузить из файла', ['uploadform'], ['class' => 'btn btn-success']);
?>
    </p>

    <?php 
$cols = [['class' => 'yii\\grid\\SerialColumn'], 'id', 'voip_number', ['attribute' => 'secret', 'value' => function ($model) {
    return Html::a($model->secret ? '* * *' : '', '', ['title' => $model->secret]);
}, 'format' => 'raw'], 'description', 'context', ['class' => Column::className(), 'content' => function ($model) use($id_wp) {
    return Html::a('Выбрать', ['voipnumbers/choicewp', 'id' => $model->id, 'id_wp' => $id_wp]);
}], ['class' => 'yii\\grid\\ActionColumn']];
if (!isset($id_wp)) {
    unset($cols[6]);
}
?>


    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => $cols]);
?>

</div>
开发者ID:Griff19,项目名称:it_base,代码行数:30,代码来源:index.php

示例3: function

<?php

/**
 * User: ivan
 * Date: 09.02.2016
 * Time: 12:31
 *
 * @var $this yii\web\View
 * @var $dp yii\data\ActiveDataProvider
 */
use yii\grid\GridView;
use yii\helpers\Html;
use yii\grid\Column;
use backend\models\Devices;
$this->title = '' . $title;
$this->params['breadcrumbs'][] = ['label' => 'Отчет', 'url' => ['reports/aindex']];
$this->params['breadcrumbs'][] = $this->title;
echo 'Отчет по устройству';
echo '<h1>' . $title . '</h1>';
echo GridView::widget(['dataProvider' => $dp, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'branch_id', 'label' => 'Подразделение'], ['attribute' => 'workplaces_title', 'label' => 'Рабочее место', 'value' => function ($dp) {
    return Html::a($dp['workplaces_title'], ['workplaces/view', 'id' => $dp['workplace_id']]);
}, 'format' => 'raw'], ['class' => Column::className(), 'header' => 'Кол-во', 'content' => function ($dp) use($type_id) {
    return Devices::getCountOnWp($type_id, $dp['workplace_id']);
}], ['attribute' => 'snp', 'label' => 'Ответственное лицо'], ['attribute' => 'job_title', 'label' => 'Должность'], ['attribute' => 'date', 'label' => 'Дата']]]);
开发者ID:Griff19,项目名称:it_base,代码行数:24,代码来源:a_employee.php

示例4: function

    </p>
    <?php 
Pjax::begin();
?>
    <?php 
if ($order_id > 0) {
    $straction = '/alt_bur/backend/web/index.php?r=listofgoods/insert&order_id=' . $order_id;
} else {
    $straction = '/alt_bur/backend/web/index.php?r=basket/insert';
}
echo '<form id = "goods" action = "' . $straction . '" method="post" enctype="multipart/form-data">';
?>
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => ['good_id', 'good_name', ['attribute' => 'good_price', 'value' => function ($model) {
    return $model->good_price / 100;
}], 'typeprices_id', ['class' => Column::className(), 'header' => '', 'content' => function ($model) use($dataProvider, &$i) {
    //return Html::a('Добавить в корзину!',['basket/insert', 'good_id' => $model->good_id, 'count' => 1, 'price' => $model->good_price, 'str' => $dataProvider->keys[$i++]]);
    $id = $dataProvider->keys[$i++];
    return '<input type="number" id = "' . $id . '" class="form-control" name="count_' . $id . '" style="float:left; width:60px" value="0" max="100" min="0">' . '<input type="hidden" id = "' . $id . '" name = "good_' . $id . '" value = "' . $id . '" >' . '<input type="hidden" id = "' . $id . '" name = "price_' . $id . '" value = "' . $model->good_price . '" >';
}, 'contentOptions' => ['style' => 'width:115px']]]]);
?>
    <?php 
echo '<input type="submit" class = "btn btn-success" value="Заказать">';
echo '</form>';
?>
   
    <?php 
Pjax::end();
?>

</div>
开发者ID:Griff19,项目名称:altbur,代码行数:31,代码来源:index_add.php

示例5: function

<?php

use yii\helpers\Html;
use yii\grid\GridView;
use yii\grid\Column;
use yii\bootstrap\Nav;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\InventoryActsSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
//$this->title = 'Устройства на рабочем месте';
//$this->params['breadcrumbs'][] = $this->title;
?>
<div class="inventory-acts-devices">

    <h1><?php 
echo 'Устройства на рабочем месте:';
?>
</h1>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'id', 'type_id', 'device_note', 'brand', 'model', 'sn', 'specification', 'parent_device_id', ['class' => Column::className(), 'content' => function ($model) use($id_wp, $modelDoc) {
    return Nav::widget(['options' => ['class' => 'navmini'], 'items' => [['label' => 'Действия', 'items' => [['label' => 'Все ОК!', 'url' => '/admin/inventory-acts-tb/create?act_id=' . $modelDoc->id . '&dev_id=' . $model['id'] . '&wp_id=' . $id_wp], ['label' => 'Пропажа!', 'url' => '#']]]]]);
}]]]);
?>
</div>

<div class="nav">
</div>
开发者ID:Griff19,项目名称:it_base,代码行数:28,代码来源:devices.php


注:本文中的yii\grid\Column::className方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。