I want to send customer id from view to controller when I select customer name from dropdown list it will send customer's id to controller. here is my code of view file 'customerlifecycleanalytic.php'
<select class="form-control selectpicker customerfilter">
<option value=''>Select Customer</option>
<?php
if (isset($customername)) {
foreach ($customername as $customernames) {
echo '<option value="' . $customernames['id'] . '" >' . $customernames['firstname'].' '. $customernames['lastname']. '</option>';
}
}
?>
</select>
here is my controller code 'Customerlifecyclecontroller'
public function actionCustomerlifecycleanalytic() {
$customername = Customer::model()->findAll("store_id='" . Yii::app()->session['store_id'] . "'");
$customerlifecycle = CustomerLifecycle::model()->findAll();
$this->renderPartial('customerlifecycleanalytic', array( 'customername' => $customername, 'customerlifecycle' => $customerlifecycle), false, true);
}