Created
April 18, 2014 13:23
-
-
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'] ?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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