M
M
McMike2017-09-15 10:35:27
Yii
McMike, 2017-09-15 10:35:27

How to call the action of another controller?

I need to do some manipulations with the data, I don’t want to edit the database with my hands, I decided to simulate an action call from another controller. It doesn't work so far. How to do it?
The required action is rendered as a separate action inherited from yii\base\action

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey Suntsev, 2017-09-15
@GreyCrew

Why call another controller when manipulating data?
There are models where the data is all described, call the model (even if it is in another module)
and work with it already.

A
Adamos, 2017-09-15
@Adamos

In OOP, for the case when the same functions are needed in two different classes, there is inheritance.

I
Igor Bezlepkin, 2017-09-15
@iBezlepkin

Essentially, you want to do a quick redirect and back. This is of course not correct.
But since you really want to, do curl on your own domain :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question