How to define a value for footer in gridview

The footer is a string, if i put in ‘value’ works fine, but in footer give me a error:


        'dataProvider' => $dataProvider,

        'showFooter' => true,

        'footerRowOptions'=>['style'=>'font-weight:bold;text-decoration: underline;'],

        'columns' => [


                'attribute' => 'XXX',

                'format' => 'currency',

                'value' => function($model) use ($anoFilter) {

                	return $model->getValorTotalParcelas($anoFilter);


                'footer' => function($model) use ($anoFilter) {

                    return $model->getValorTotal($anoFilter);




The footer parameter should be a string. You can’t set it as an anonymous function.

Thanks for reply. How the better way to get the return value from that method and put in footer?