1 | <?php |
||
19 | class UrlHelper extends Base |
||
20 | { |
||
21 | private $base = ''; |
||
22 | private $directory = ''; |
||
23 | |||
24 | /** |
||
25 | * Helper to generate a link to the documentation. |
||
26 | * |
||
27 | * @param string $label |
||
28 | * @param string $file |
||
29 | * |
||
30 | * @return string |
||
31 | */ |
||
32 | public function doc($label, $file) |
||
36 | |||
37 | /** |
||
38 | * Button Link Element. |
||
39 | * |
||
40 | * @param string $icon Font-Awesome icon |
||
41 | * @param string $label Link label |
||
42 | * @param string $controller Controller name |
||
43 | * @param string $action Action name |
||
44 | * @param array $params Url parameters |
||
45 | * @param string $class CSS class attribute |
||
46 | * |
||
47 | * @return string |
||
48 | */ |
||
49 | public function button($icon, $label, $controller, $action, array $params = [], $class = '') |
||
56 | |||
57 | /** |
||
58 | * Link element. |
||
59 | * |
||
60 | * @param string $label Link label |
||
61 | * @param string $controller Controller name |
||
62 | * @param string $action Action name |
||
63 | * @param array $params Url parameters |
||
64 | * @param bool $csrf Add a CSRF token |
||
65 | * @param string $class CSS class attribute |
||
66 | * @param string $title Link title |
||
67 | * @param bool $new_tab Open the link in a new tab |
||
68 | * @param string $anchor Link Anchor |
||
69 | * @param bool $absolute |
||
70 | * |
||
71 | * @return string |
||
72 | */ |
||
73 | public function link($label, $controller, $action, array $params = [], $csrf = false, $class = '', $title = '', $new_tab = false, $anchor = '', $absolute = false) |
||
77 | |||
78 | /** |
||
79 | * Absolute link. |
||
80 | * |
||
81 | * @param string $label |
||
82 | * @param string $controller |
||
83 | * @param string $action |
||
84 | * @param array $params |
||
85 | * |
||
86 | * @return string |
||
87 | */ |
||
88 | public function absoluteLink($label, $controller, $action, array $params = []) |
||
92 | |||
93 | /** |
||
94 | * HTML Hyperlink. |
||
95 | * |
||
96 | * @param string $controller Controller name |
||
97 | * @param string $action Action name |
||
98 | * @param array $params Url parameters |
||
99 | * @param bool $csrf Add a CSRF token |
||
100 | * @param string $anchor Link Anchor |
||
101 | * @param bool $absolute Absolute or relative link |
||
102 | * |
||
103 | * @return string |
||
104 | */ |
||
105 | public function href($controller, $action, array $params = [], $csrf = false, $anchor = '', $absolute = false) |
||
113 | |||
114 | /** |
||
115 | * Generate controller/action url. |
||
116 | * |
||
117 | * @param string $controller Controller name |
||
118 | * @param string $action Action name |
||
119 | * @param array $params Url parameters |
||
120 | * @param string $anchor Link Anchor |
||
121 | * @param bool $absolute Absolute or relative link |
||
122 | * |
||
123 | * @return string |
||
124 | */ |
||
125 | public function to($controller, $action, array $params = [], $anchor = '', $absolute = false) |
||
129 | |||
130 | /** |
||
131 | * Get application base url. |
||
132 | * |
||
133 | * @return string |
||
134 | */ |
||
135 | public function base() |
||
143 | |||
144 | /** |
||
145 | * Get application base directory. |
||
146 | * |
||
147 | * @return string |
||
148 | */ |
||
149 | public function dir() |
||
159 | |||
160 | /** |
||
161 | * Get current server base url. |
||
162 | * |
||
163 | * @return string |
||
164 | */ |
||
165 | public function server() |
||
178 | |||
179 | /** |
||
180 | * Build relative url. |
||
181 | * |
||
182 | * @param string $separator Querystring argument separator |
||
183 | * @param string $controller Controller name |
||
184 | * @param string $action Action name |
||
185 | * @param array $params Url parameters |
||
186 | * @param bool $csrf Add a CSRF token |
||
187 | * @param string $anchor Link Anchor |
||
188 | * @param bool $absolute Absolute or relative link |
||
189 | * |
||
190 | * @return string |
||
191 | */ |
||
192 | protected function build($separator, $controller, $action, array $params = [], $csrf = false, $anchor = '', $absolute = false) |
||
220 | } |
||
221 |
Since your code implements the magic getter
_get
, this function will be called for any read access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.