matej21/nette-autowire-component-factories

Lazy-Autowire of properties for Nette PresenterComponents.

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

This package is auto-updated.

Last update: 2024-10-29 04:14:32 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;

    }
}