D
D
deepin2019-08-14 12:25:55
PHP
deepin, 2019-08-14 12:25:55

Is it possible to fill a property in a constructor without checking for a POST request?

So?

свойство = метод_модели(); // внутри метода используется POST_запрос

Or so?
if (POST_запрос) свойство = метод_модели(); // внутри метода используется POST_запрос

The property is used in the action as follows,
if (POST_запрос) обращение к свойству
that is, we accessed the property in the action only after checking for a POST_request.
Do we need to check it in the constructor when filling?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Northern Lights, 2019-08-14
@deepin

superglobals do not need to be used (written explicitly) within objects. get away from it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question