1 | <?php |
||
18 | class TemplatePlugin |
||
19 | { |
||
20 | |||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | private $publicDir; |
||
25 | |||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | private $srcDir; |
||
30 | |||
31 | /** |
||
32 | * @var ParserFactory |
||
33 | */ |
||
34 | private $parserFactory; |
||
35 | |||
36 | /** |
||
37 | * @var ResponsiveFactory |
||
38 | */ |
||
39 | private $responsiveFactory; |
||
40 | |||
41 | /** |
||
42 | * @var CSSmin |
||
43 | */ |
||
44 | private $cssMinifier; |
||
45 | |||
46 | /** |
||
47 | * @var bool |
||
48 | */ |
||
49 | private $minify; |
||
50 | |||
51 | /** |
||
52 | * @var Page |
||
53 | */ |
||
54 | private $page; |
||
55 | |||
56 | public function __construct( |
||
71 | |||
72 | /** |
||
73 | * @param Page $page |
||
74 | * |
||
75 | * @return TemplatePlugin |
||
76 | */ |
||
77 | public function setPage(Page $page) : TemplatePlugin { |
||
82 | |||
83 | /** |
||
84 | * This function will read meta configuration from `meta` and output the corresponding meta tags. |
||
85 | * |
||
86 | * @param array $extra |
||
87 | * |
||
88 | * @return string |
||
89 | */ |
||
90 | public function meta(array $extra = []) : string { |
||
99 | |||
100 | /** |
||
101 | * This function will take a source path and an optional inline parameter. |
||
102 | * The CSS file will be copied from the source path to the public directory. |
||
103 | * If the `minify` option is set to true in config.yml, the output will be minified. |
||
104 | * |
||
105 | * If the inline parameter is set, the output won't be copied to a public file, |
||
106 | * but instead be outputted to an HTML string which can be included in a template. |
||
107 | * |
||
108 | * Files with the .scss and .sass extensions will be compiled to normal CSS files. |
||
109 | * |
||
110 | * @param string $src |
||
111 | * @param bool $inline |
||
112 | * |
||
113 | * @return string |
||
114 | */ |
||
115 | public function css($src, $inline = false) { |
||
139 | |||
140 | /** |
||
141 | * This function will take a source path and an optional inline parameter. |
||
142 | * The JS file will be copied from the source path to the public directory. |
||
143 | * If the `minify` option is set to true in config.yml, the output will be minified. |
||
144 | * |
||
145 | * If the inline parameter is set, the output won't be copied to a public file, |
||
146 | * but instead be outputted to an HTML string which can be included in a template. |
||
147 | * |
||
148 | * @param string $src |
||
149 | * @param bool $inline |
||
150 | * @param bool $async |
||
151 | * |
||
152 | * @return string |
||
153 | */ |
||
154 | public function js($src, $inline = false, $async = false) { |
||
184 | |||
185 | /** |
||
186 | * Create a responsive image using brendt\responsive-images. |
||
187 | * |
||
188 | * @param $src |
||
189 | * |
||
190 | * @return array |
||
191 | * |
||
192 | * @see \Brendt\Image\ResponsiveFactory |
||
193 | */ |
||
194 | public function image($src) { |
||
207 | |||
208 | /** |
||
209 | * Create a public file from the src directory and return its path. |
||
210 | * |
||
211 | * @param $src |
||
212 | * |
||
213 | * @return null|string |
||
214 | */ |
||
215 | public function file($src) { |
||
237 | |||
238 | } |
||
239 |