M
M
Mister88912015-11-10 00:11:13
Yii
Mister8891, 2015-11-10 00:11:13

How to call controller in Yii2& controller?

Can't call controller in controller. Is it even possible? I really need.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
H
HaruAtari, 2015-11-10
@Mister8891

You need the runAction()
method Write: \Yii::$app->runAction("controllerId/actionId")Or use any route you need.

S
Sergey, 2015-11-10
Protko @Fesor

I really need.

you need to move the business logic into services and pull it from any controllers you like.

A
Andrew, 2015-11-10
@R0dger

You violate MVC if you want to call the controller from the controller .. just think about it .. what is wrong with you ...
all the logic is in the Model, the display is in the View )))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question