컨트롤러 :YII CGridView 오류
public function actionItem($textdata){
$dataProvider = new CActiveDataProvider('Mytest', array(
'criteria' => array(
'condition' => 'type="'.$textdata.'"',
),
));
$bleble = $textdata;
$this->render('Item', array(
'dataProvider' => $dataProvider,
'bleble' => $bleble,
));
}
전망 :
$bleble = $bleble;
$this->widget('zii.widgets.grid.CGridView', array(
'id' => 'sample_id',
'dataProvider' => $dataProvider,
'columns' => array(
array(
'header' => 'id',
'name' => 'id',
'value' =>'$data->id',
'type' =>'raw',
"value" => function($data){
echo "text".$data->id;
},
),
NEED! :
$bleble = $bleble;
$this->widget('zii.widgets.grid.CGridView', array(
'id' => 'sample_id',
'dataProvider' => $dataProvider,
'columns' => array(
array(
'header' => 'id',
'name' => 'id',
'value' =>'$data->id',
'type' =>'raw',
"value" => function($data){
echo $bleble.$data->id;
},
),
오류 :
PHP 고지 정의되지 않은 변수 : 내가해야하는 일을 내가 컨트롤러 ($ 텍스트)이 $ 텍스트가 어떻게 링크의 텍스트를 다운로드 할 bleble
필요 테이블을 쓰지만 변수 일 때는 작동하지 않습니다. 일반 텍스트는 예를 들어 echo "text"와 같습니다. $ data-> id;
여전히 작동하지 않습니다이 작동, "값"=> 기능 ($ 데이터) { 에코 $의 bleble을 $ 데이터 -> ID; } 어떻게 든 교환 할 필요가 있습니다. 예를 들어 TEXT가 TEXT_1, TEXT_2, TEXT_3과 같이 컨트롤러에 표시됩니다. 여기서 번호는 ID가 – ubgsdnhfj