Skip to content

Instantly share code, notes, and snippets.

@mahana123
Created April 18, 2014 13:23
Show Gist options
  • Save mahana123/11044076 to your computer and use it in GitHub Desktop.
Save mahana123/11044076 to your computer and use it in GitHub Desktop.
how to pass the parameter to actionID which can only be access by argument not by $_GET['parameter_name'] ?
public function actionUpdate( $postID = null ) {
echo $_GET['postID'];
echo $postID;
$model = new PostForm;
$this->render('update',array(
'model'=>$model, // Model is passed to create.php View!
));
}
$this->widget('zii.widgets.grid.CGridView', array(
'dataProvider'=>$dataProvider,
'columns'=>array(
'description',
array(
'name'=>'post_time',
'value'=>'date("M j, Y", strtotime($data->post_time))',
),
array( // display a column with "view", "update" and "delete" buttons
'class'=>'CButtonColumn',
'template'=>'{delete}{update}',
'buttons'=>array(
'update' => array
(
'url'=>'CController::createUrl("/post/update", array("postID"=>$data->primaryKey))',
),
'delete' => array
(
'url'=>'CController::createUrl("/post/delete", array("postID"=>$data->primaryKey))',
),
),
),
),
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment