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

Action Delete

$
0
0
i couldn't delete use action delete on host

show

Error 400
Your request is invalid.


here is my controller

public function actionDelete($id)
{
$this->loadModel($id)->delete();

// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser
if(!isset($_GET['ajax']))
$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));
}


here is view

$this->menu=array(
array('label'=>'List Places', 'url'=>array('index')),
array('label'=>'Create Places', 'url'=>array('create')),
array('label'=>'Update Places', 'url'=>array('update', 'id'=>$model->id)),
array('label'=>'Delete Places', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')),
array('label'=>'Manage Places', 'url'=>array('admin')),
);



how solve this

Viewing all articles
Browse latest Browse all 18717

Trending Articles



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