1 | <?php |
||
32 | class Helper |
||
33 | { |
||
34 | /** |
||
35 | * The base url of the app. Used by helpers which need to build full URLS. |
||
36 | * This variable is used in the Helper::makeFullUrl method. |
||
37 | * @var string |
||
38 | */ |
||
39 | private static $baseUrl; |
||
40 | |||
41 | /** |
||
42 | * A sort of constructor or entry point for helpers. |
||
43 | * @param mixed $arguments |
||
44 | * @return \ntentan\honam\Helper |
||
45 | */ |
||
46 | public function help($arguments) |
||
47 | { |
||
48 | return $this; |
||
49 | } |
||
50 | |||
51 | /** |
||
52 | * Set the base url used in the helpers. |
||
53 | * @param string $url The new base url |
||
54 | */ |
||
55 | public static function setBaseUrl($url) |
||
59 | |||
60 | /** |
||
61 | * Generate a full url by concatenating the base url with a path. |
||
62 | * |
||
63 | * @param string $url |
||
64 | * @return string |
||
65 | */ |
||
66 | 4 | protected function makeFullUrl($url) |
|
70 | } |
||
71 |