Give an example of a good solution for using traits in PHP. (or describe the situation when the decision to use the traits will be justified or even the only correct one)

    1 answer 1

    This is a great replacement for multiple inheritance. A working example is the implementation of “fat” models — when form validation methods are put into a trait and simply connected to models.

    • If you also offer some code, I will thank you and close this question. - Alexey Danchin