| 1 | <?php namespace rtens\domin\delivery\web\menu; |
||
| 6 | class ActionMenuItem implements MenuItem { |
||
| 7 | |||
| 8 | /** @var string */ |
||
| 9 | private $actionId; |
||
| 10 | |||
| 11 | /** @var array */ |
||
| 12 | private $parameters; |
||
| 13 | |||
| 14 | /** @var string */ |
||
| 15 | private $caption; |
||
| 16 | |||
| 17 | public function __construct($caption, $actionId, $parameters = []) { |
||
| 18 | $this->actionId = $actionId; |
||
| 19 | $this->parameters = $parameters; |
||
| 20 | $this->caption = $caption; |
||
| 21 | } |
||
| 22 | |||
| 23 | public function render() { |
||
| 24 | return new Element('li', [], [ |
||
| 25 | new Element('a', ['href' => (string)Url::relative($this->actionId, $this->parameters)], [$this->getCaption()]) |
||
| 26 | ]); |
||
| 27 | } |
||
| 28 | |||
| 29 | private function getCaption() { |
||
| 32 | } |