Hey, how are you all?
Someone can tell me how to get an especific param from this lane?
In my code I want to get wk_liq_ana_cli_nro_oc from:
Yii::$app->request->queryParams
All the code for more information:
public function actionIndex()
{
$searchModel = new LaboratorioAlfaSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
if ($dataProvider->getTotalCount() == 0) {
$analisisClinicosVista = VLaboratorioAlfa::findAll([v_nro_oc => Yii::$app->getRequest()->getQueryParam('wk_liq_ana_cli_nro_oc')]);
foreach ($analisisClinicosVista as $analisis) {
LaboratorioAlfa::registrarAnalisisClinicoDesdeVista($analisis);
}
}
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
}
If I do:
var_dump(Yii::$app->request->queryParams);exit;
returns me: array(2) { ["r"]=> string(22) "laboratorio-alfa/index" ["LaboratorioAlfaSearch"]=> array(1) { ["wk_liq_ana_cli_nro_oc"]=> string(5) "78610" } }
But if I do:
var_dump(Yii::$app->getRequest()->getQueryParam('wk_liq_ana_cli_nro_oc'));exit;
returns me NULL
Thanks thanks thanks!