1 | <?php |
||
16 | class TagBuilder implements RenderableInterface |
||
17 | { |
||
18 | /** |
||
19 | * @var TagFactory |
||
20 | */ |
||
21 | protected $tagFactory; |
||
22 | |||
23 | /** |
||
24 | * @var TitleTag |
||
25 | */ |
||
26 | protected $title; |
||
27 | |||
28 | /** |
||
29 | * @var MetaTag[] |
||
30 | */ |
||
31 | protected $metas = []; |
||
32 | |||
33 | /** |
||
34 | * @var LinkTag[] |
||
35 | */ |
||
36 | protected $links = []; |
||
37 | |||
38 | /** |
||
39 | * TagBuilder constructor. |
||
40 | * |
||
41 | * @param TagFactory $tagFactory |
||
42 | */ |
||
43 | public function __construct(TagFactory $tagFactory) |
||
47 | |||
48 | /** |
||
49 | * @param string $title |
||
50 | * |
||
51 | * @return TitleTag |
||
52 | */ |
||
53 | public function setTitle($title) |
||
59 | |||
60 | /** |
||
61 | * @return TitleTag |
||
62 | */ |
||
63 | public function getTitle() |
||
67 | |||
68 | /** |
||
69 | * @param string $name |
||
70 | * @param string|null $type |
||
71 | * @param string|null $value |
||
72 | * @param string|null $content |
||
73 | * |
||
74 | * @return MetaTag |
||
75 | */ |
||
76 | public function addMeta($name, $type = MetaTag::NAME_TYPE, $value = null, $content = null) |
||
84 | |||
85 | /** |
||
86 | * @param $name |
||
87 | * |
||
88 | * @return MetaTag|null |
||
89 | */ |
||
90 | public function getMeta($name) |
||
94 | |||
95 | /** |
||
96 | * @param string $name |
||
97 | * @param string|null $href |
||
98 | * @param string|null $rel |
||
99 | * @param string|null $type |
||
100 | * @param string|null $title |
||
101 | * |
||
102 | * @return LinkTag |
||
103 | */ |
||
104 | public function addLink($name, $href = null, $rel = null, $type = null, $title = null) |
||
113 | |||
114 | /** |
||
115 | * @param string $name |
||
116 | * |
||
117 | * @return LinkTag|null |
||
118 | */ |
||
119 | public function getLink($name) |
||
123 | |||
124 | /** |
||
125 | * @return string |
||
126 | */ |
||
127 | public function render() |
||
147 | |||
148 | /** |
||
149 | * @return string |
||
150 | */ |
||
151 | public function __toString() |
||
155 | } |
||
156 |