1 | <?php |
||
17 | class TemplatePlugin |
||
18 | { |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | private $publicDir; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | private $srcDir; |
||
29 | |||
30 | /** |
||
31 | * @var ParserFactory |
||
32 | */ |
||
33 | private $parserFactory; |
||
34 | |||
35 | /** |
||
36 | * @var ResponsiveFactory |
||
37 | */ |
||
38 | private $responsiveFactory; |
||
39 | |||
40 | /** |
||
41 | * @var CSSmin |
||
42 | */ |
||
43 | private $cssMinifier; |
||
44 | |||
45 | /** |
||
46 | * @var array |
||
47 | */ |
||
48 | private $meta; |
||
49 | |||
50 | /** |
||
51 | * @var bool |
||
52 | */ |
||
53 | private $minify; |
||
54 | |||
55 | public function __construct( |
||
73 | |||
74 | /** |
||
75 | * This function will read meta configuration from `meta` and output the corresponding meta tags. |
||
76 | * |
||
77 | * @param array $meta |
||
78 | * |
||
79 | * @return string |
||
80 | */ |
||
81 | public function meta(array $meta = []) : string { |
||
96 | |||
97 | /** |
||
98 | * This function will take a source path and an optional inline parameter. |
||
99 | * The CSS file will be copied from the source path to the public directory. |
||
100 | * If the `minify` option is set to true in config.yml, the output will be minified. |
||
101 | * |
||
102 | * If the inline parameter is set, the output won't be copied to a public file, |
||
103 | * but instead be outputted to an HTML string which can be included in a template. |
||
104 | * |
||
105 | * Files with the .scss and .sass extensions will be compiled to normal CSS files. |
||
106 | * |
||
107 | * @param string $src |
||
108 | * @param bool $inline |
||
109 | * |
||
110 | * @return string |
||
111 | */ |
||
112 | public function css($src, $inline = false) { |
||
136 | |||
137 | /** |
||
138 | * This function will take a source path and an optional inline parameter. |
||
139 | * The JS file will be copied from the source path to the public directory. |
||
140 | * If the `minify` option is set to true in config.yml, the output will be minified. |
||
141 | * |
||
142 | * If the inline parameter is set, the output won't be copied to a public file, |
||
143 | * but instead be outputted to an HTML string which can be included in a template. |
||
144 | * |
||
145 | * @param string $src |
||
146 | * @param bool $inline |
||
147 | * @param bool $async |
||
148 | * |
||
149 | * @return string |
||
150 | */ |
||
151 | public function js($src, $inline = false, $async = false) { |
||
181 | |||
182 | /** |
||
183 | * Create a responsive image using brendt\responsive-images. |
||
184 | * |
||
185 | * @param $src |
||
186 | * |
||
187 | * @return array |
||
188 | * |
||
189 | * @see \Brendt\Image\ResponsiveFactory |
||
190 | */ |
||
191 | public function image($src) { |
||
204 | |||
205 | /** |
||
206 | * Create a public file from the src directory and return its path. |
||
207 | * |
||
208 | * @param $src |
||
209 | * |
||
210 | * @return null|string |
||
211 | */ |
||
212 | public function file($src) { |
||
234 | |||
235 | } |
||
236 |