matej21/nette-autowire-component-factories

This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

Lazy-Autowire of properties for Nette PresenterComponents.

dev-master 2013-03-06 17:34 UTC

This package is auto-updated.

Last update: 2021-11-29 01:53:43 UTC


README

discussion: http://forum.nette.org/cs/13791-createcomponent-injectovani-tovarnicky-primo-do-metody (czech only)

Include in application

abstract class BasePresenter extends Nette\Application\UI\Presenter
{
	use \matej21\AutowireComponentFactories;

}

Usage

class FooPresenter extends BasePresenter
{

    public function createComponentBar(BarFactory $factory)
    {
        $component = $factory->create();
        return $component;

    }
}