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:
11:
12: /**
13: * Component multiplier.
14: */
15: class Multiplier extends Component
16: {
17: /** @var callable */
18: private $factory;
19:
20:
21: public function __construct(callable $factory)
22: {
23: parent::__construct();
24: $this->factory = $factory;
25: }
26:
27:
28: protected function createComponent($name)
29: {
30: return call_user_func($this->factory, $name, $this);
31: }
32: }
33: