Ticket #160 (new enhancement)

Opened 4 months ago

Last modified 4 months ago

Provide injection of registry values

Reported by: mikey Assigned to: mikey
Priority: major Milestone:
Component: InversionOfControl Version: SVN-trunk
Keywords: Cc:

Description (Last modified by mikey)

The IoC container should provide a way to inject constant values directly from the registry:

class Example extends stubBaseObject
{
    /**
     * sets the example value
     *
     * @param  string  $exampleValue
     * @Registry(key='example.registry.key', default='foo')
     */
    public function setExampleValue($exampleValue)
    {
        // do something with $exampleValue
    }
}

When class Example is now created with the IoC container, it will detect the @Registry annotation and call the method with the value stored under the key example.registry.key from the registry. The default will be used in case no value is stored with this key.

Change History

07/29/08 14:12:38 changed by mikey

  • description changed.