Use Model Id In Linkcolumn

Hey,

i try to use a Id from a Model in a Link Column like the following code:




$this->widget('bootstrap.widgets.TbGridView', array(

			'dataProvider' => $dataProvider,

			'filter' => $model,

			'template' => "{items}",

			'columns' => array(

				array(

					'class' => 'CLinkColumn',

					'label' => 'edit',

					'url' => 'index.php/wordList/edit&id=' . $model->id,

				),

			),

		)

	); 



If i click on the edit label then the browser directs me to:

"wordList/edit&id="

I would be pleased if someone can explain how i get the id from the model to use it in my link expression above.

Use the urlExpression instead of ‘url’:




...

             array(

                   'class' => 'CLinkColumn',

                   'label' => 'edit',

                   'urlExpression' => 'Yii::app()->createUrl("wordList/edit",array("id"=>$data->id))',

                  ),

             ),




But you can use the TbButtonColumm (extends CButtonColumn) too

See CButtonColumns

CButtonColumn Wiki