Skip to content

matej21/nette-autowire-component-factories

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Autowire arguments in createComponent* methods

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;

    }
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages