I
I
ImPuuLsE2015-06-03 11:25:58
Yii
ImPuuLsE, 2015-06-03 11:25:58

Why use ActiveController in REST in Yii2?

Hello! there is such an example on github - https://github.com/iiYii/yii2-rest-demo/blob/maste...
Tell me , what is the purpose of inheriting from ActiveController if all default methods are reassigned anyway? Maybe I'm missing something?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Golubev, 2015-06-03
@wladyspb

Perhaps inheritance is used for a classic reason? Somewhere it is necessary that the controller be defined as ActiveController or correspond to its interface. This is IMHO, I do not pretend to be the right answer)

R
Ruslan Makhin, 2019-01-14
@rusya_mahin_page

Most likely overridden only as an example
Because, if I'm not mistaken, specifying `$modelClass` yii2 will itself carry out the necessary operations (described just the same in the controller methods)
Just in this case, the class will go to 5 lines and how else to explain what is here happening?)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question