1 | <?php |
||
35 | class Helper |
||
36 | { |
||
37 | /** |
||
38 | * The base url of the app. Used by helpers which need to build full URLS. |
||
39 | * This variable is used in the Helper::makeFullUrl method. |
||
40 | * @var string |
||
41 | */ |
||
42 | private $baseUrl; |
||
43 | |||
44 | protected $templateRenderer; |
||
45 | |||
46 | public function __construct(TemplateRenderer $templateRenderer) |
||
50 | |||
51 | |||
52 | /** |
||
53 | * A sort of constructor or entry point for helpers. |
||
54 | * @param mixed $arguments |
||
55 | * @return Helper |
||
56 | */ |
||
57 | public function help($arguments) |
||
61 | |||
62 | /** |
||
63 | * Set the base url used in the helpers. |
||
64 | * @param string $url The new base url |
||
65 | */ |
||
66 | public function setBaseUrl($url) |
||
70 | |||
71 | /** |
||
72 | * Generate a full url by concatenating the base url with a path. |
||
73 | * |
||
74 | * @param string $url |
||
75 | * @return string |
||
76 | */ |
||
77 | protected function makeFullUrl($url) |
||
81 | |||
82 | } |
||
83 |