1: <?php
2:
3: /**
4: * This file is part of the Nette Framework (https://nette.org)
5: * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
6: */
7:
8: namespace Nette\Application\UI;
9:
10: use Nette;
11:
12:
13: /**
14: * Component multiplier.
15: */
16: class Multiplier extends Component
17: {
18: /** @var callable */
19: private $factory;
20:
21:
22: public function __construct(callable $factory)
23: {
24: parent::__construct();
25: $this->factory = $factory;
26: }
27:
28:
29: protected function createComponent($name)
30: {
31: return call_user_func($this->factory, $name, $this);
32: }
33: }
34: