【发布时间】:2017-07-18 22:06:08
【问题描述】:
这是我的 GridView 的代码。我希望页脚与其列具有相同的格式。我该怎么做?谢谢!
echo GridView::widget([
'dataProvider' => $dataProvider,
'showFooter' => true,
'formatter' => ['class' => 'yii\i18n\Formatter','thousandSeparator' => ',','currencyCode' => 'PHP',],
'columns' => [
['class' => 'yii\grid\SerialColumn'],
[
'attribute' =>'account_code',
'footer' =>'Total',
],
'account_name',
[
'attribute' =>'amount',
'format' => 'currency',
'footer' => Accounts::getTotal($dataProvider->models, 'amount'),
],
['class' => 'yii\grid\ActionColumn'],
],
]);
【问题讨论】: