Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Cbuttoncolumn - Adding Dynamic Parameters To Button Url

$
0
0
I have 2 database tables, yii_quote & yii_valuation. A quote contains 0:M valuation. The models have been scaffolded accordingly.

When a user is at the
Quote/admin CGridView
, and they click View from the default CButtonColumn, I wish to override the default behaviour of the view button to direct them to
Valuation/Admin?q=:quote_id


Where
:quote_id
is the id of the quote / current row id.

How do I add this dynamic parameter to the URL?

At present, I have:

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'quote-grid',
	'dataProvider'=>$model->search(),
	'columns'=>array(
                ...
                ... Quote Related Columns ...
                ...
		array(
			'class'=>'CButtonColumn',
                'buttons' => array(
                    'view' => array (
                        'url' => "Yii::app()->controller->createUrl('valuation/admin', q= // SOMETHING HERE //  )",
                    ),
                ),
		),
	),
)); ?>

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>