1 | <?php |
||
17 | trait ConfigurableTrait |
||
18 | { |
||
19 | /** |
||
20 | * Constructor. |
||
21 | * The default implementation does two things: |
||
22 | * |
||
23 | * - Initializes the object with the given configuration `$config`. |
||
24 | * - Call [[init()]]. |
||
25 | * |
||
26 | * If this method is overridden in a child class, it is recommended that |
||
27 | * |
||
28 | * - the last parameter of the constructor is a configuration array, like `$config` here. |
||
29 | * - call the parent implementation at the end of the constructor. |
||
30 | * |
||
31 | * @param array $config name-value pairs that will be used to initialize the object properties |
||
32 | */ |
||
33 | public function __construct($config = []) |
||
40 | |||
41 | /** |
||
42 | * Initializes the object. |
||
43 | * This method is invoked at the end of the constructor after the object is initialized with the |
||
44 | * given configuration. |
||
45 | */ |
||
46 | public function init() |
||
49 | } |
||
50 |