Reputation: 220
I used runAction()
function to launch action within another action in the same controller.
Yii::$app->runAction('main/goods', ['model_id' => $goods->id]);
. How to get this variable in actionGoods()
?
Upvotes: 10
Views: 10129
Reputation: 133360
Try this way
Yii::$app->runAction('main/goods', ['model_id' => $goods->id]);
In MainController
public function actionGoods($model_id)
{
..... yuor code
}
Upvotes: 16