Passing An Array To An Action From A Partially Rendered View

I have this code in my partially rendered view:




echo CHtml::linkButton('Proceed', array(

     'submit'=>array('engineering/acquiredsubjects','subjects'=>$selectedsubj),

));



But it seems nothing is being passed to my controller action…

You’ll need to serialise the array so that it can be processed.

Assuming you can use | as a delimiting character, try:




echo CHtml::linkButton('Proceed', array(

     'submit'=>array('engineering/acquiredsubjects','subjects'=>implode('|', $selectedsubj)),

));



Then in the controller:




$subjArr = explode('|', $subjects);