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

Ajaxlink Is Not Passing Variable To Controller

$
0
0
I am trying to pass a variable from an ajaxLink into my controller but my controller is not getting the variable.

//view

    $ids = Yii::app()->storedData->getIds();
        foreach($ids as $id) {
        echo 'ID '.$id .'<br />';
        
        echo CHtml::ajaxLink(	
         'remove', 									  
         array('/storedInfo/remove'), 
         array(
          'data' => array('removeItem' => $id),
        ));
        } 


//controller

 public function actionRemove() {
    		var_dump($_GET['removeItem']);  // RETURNS string(0) ""
    		die();
    	}

Viewing all articles
Browse latest Browse all 18717

Trending Articles



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