Respect / Config

A powerful, small, deadly simple configurator and dependency injection container DSL made to be easy
http://respect.github.io/Config
Other
98 stars 7 forks source link

Support for builders #27

Closed alganet closed 11 years ago

alganet commented 12 years ago

A declarative way of creating builders with Config would be:

[router new Respect\Rest\Router]

Any call to $container->router would lead to a new instance, avoiding reuse. Difference from current syntax is the new keyword.

nickl- commented 11 years ago

Seems do-able...

$r1 = $container->router; // new  instance of Router
$r2 = $container->router; // a brand new instance of Router 
alganet commented 11 years ago

I guess I've already implemented this and forgot the issue opened:

https://gist.github.com/alganet/3735358

nickl- commented 11 years ago

:cloud: