request->isAjax) { // $user = Yii::$app->user->id; $array = Yii::$app->getRequest ()->getBodyParams () ['MultiunitsForm']; $final = $array ['checked']; $units = [ ]; // "/" were replaced by "SLASH" in the var names it needs to be re-replaced during // entry in shopping cart. foreach ( $final as $key => $value ) { if($value == 1){ if (preg_match ( '*SLASH*', $key )) { unset ( $final [$key] ); $key = str_replace ( 'SLASH', '/', $key ); $key = str_replace ( 'PARO', '(', $key ); $key = str_replace ( 'PARF', ')', $key ); $key = str_replace ( 'DBLPT', ':', $key ); $units [] = explode ( "---", $key ); } else { $key = str_replace ( 'PARO', '(', $key ); $key = str_replace ( 'PARF', ')', $key ); $key = str_replace ( 'DBLPT', ':', $key ); $units [] = explode ( "---", $key ); } } } // foreach ( $units as $u => $v ) // Yii::info ( "MULTIUNITS " . implode ( " ", $v ) ); Yii::$app->session->set ( 'multiunits', $units ); Yii::$app->session->set ( 'referrer', Yii::$app->request->referrer ); // } } /** * function updating the pjax widget, which shows the shopping cart content. * * @return string */ public function actionAddedlist() { Yii::info ( "yeahhh" ); $units = Yii::$app->session ['multiunits']; $url = Url::to ( array_merge ( [ 'search/record' ], [ 'unitID' => $units [0] [0], 'collectioncode'=>$units[0][1], 'institutioncode'=>$units[0][2]])); // Yii::info("URL : ".$url); $this->redirect($url); } }