Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to pass parameter on redirect in yii

Tags:

php

yii

I am using Yii framework for my project;

I am redirecting page after success of insertion in database to another controller using

$this->redirect($this->createUrl('controller/action'));

During the redirection is it possible to pass any parameters just like in render,

$this->render('selectRefiner', array('param' => $data)

like image 846
Abhi Avatar asked Dec 05 '12 05:12

Abhi


2 Answers

Try:

$this->redirect(array('controller/action', 'param1'=>'value1', 'param2'=>'value2',...))

api yii 1, api yii 2

like image 191
driver_by Avatar answered Nov 14 '22 12:11

driver_by


try this:

Yii::$app->response->redirect(['site/dashboard','id' => 1, 'var1' => 'test']);
like image 2
Rahul Pawar Avatar answered Nov 14 '22 12:11

Rahul Pawar