Yii2 php, help in the model

0

Good morning, I have the column, of code and in yii if one puts 0 after the name of the other table pulls the information ... but I can not do the search, which I have programmed in the model ??

use yii\helpers\Url;

return [

 [
    'class'=>'\kartik\grid\DataColumn',
    'attribute'=>'codigo0.NombreComercial',
],
    
asked by Héctor Ramírez 08.01.2018 в 16:52
source

1 answer

0

This portion of the code can be used to create a drop-down list, with all your stores. It only remains that you modify it by the attribute names of your model.

[
    'class'    => '\kartik\grid\DataColumn',
    'attribute'=> 'rucprove',
    'value'    => 'rucprove0.nomprove',
    'filter'   => \yii\helpers\ArrayHelper::map(
                        app\models\Proveedor::find()
                             ->orderBy('nomprove')->asArray()
                             ->all(), 
                             'ruc', 'nomprove'), 
],
    
answered by 11.01.2018 в 02:54