Applying injection order

Hello! I use phalcon 1.3 for few days. I have such code:

    $di->setShared($componentName, array(
        'className' => $class,
        'properties' => $properties,
        'calls' => array(
            array(
                'method' => 'init',
                'arguments' => array()
            )
        ),
    ));

When method init() is invoked on some object calls, the object has no set properties yet. Can I change this behavior? I need set properties before calling init().



30.7k
edited Mar '14

Hi, maybe you can use the onConstruct() method, that one is available for controllers, I don't know for user components. Otherwise I'm thinking of http://docs.phalconphp.com/en/latest/reference/applications.html#application-events and eventsmanager