Skip to content
Newer
Older
100644 38 lines (26 sloc) 757 Bytes
7056c0e @janmarek readme in utf8
janmarek authored
1 WebLoader
0377250 @janmarek readme
janmarek authored
2 =========
3
2b04775 @janmarek updated readme
janmarek authored
4 Component for CSS and JS files loading
0377250 @janmarek readme
janmarek authored
5
2b04775 @janmarek updated readme
janmarek authored
6 Author: Jan Marek
0377250 @janmarek readme
janmarek authored
7 Licence: MIT
8
2b04775 @janmarek updated readme
janmarek authored
9 Example:
0377250 @janmarek readme
janmarek authored
10
11 <?php
12
2b04775 @janmarek updated readme
janmarek authored
13 // presenter factory in nette
0377250 @janmarek readme
janmarek authored
14
2b04775 @janmarek updated readme
janmarek authored
15 protected function createComponentCss()
16 {
17 $files = new WebLoader\FileCollection(WWW_DIR . '/css');
18 $files->addFiles(array(
19 'style.css',
20 WWW_DIR . '/colorbox/colorbox.css',
21 ));
0377250 @janmarek readme
janmarek authored
22
f04fca6 @kukulich Fixed example
kukulich authored
23 $compiler = WebLoader\Compiler::createCssCompiler($files, WWW_DIR . '/temp');
0377250 @janmarek readme
janmarek authored
24
2b04775 @janmarek updated readme
janmarek authored
25 $compiler->addFilter(new WebLoader\Filter\VariablesFilter(array('foo' => 'bar'));
26 $compiler->addFilter(function ($code) {
27 return cssmin::minify($code, "remove-last-semicolon");
28 });
0377250 @janmarek readme
janmarek authored
29
0e4848f @janmarek nette integration
janmarek authored
30 $control = new WebLoader\Nette\CssLoader($compiler, '/webtemp');
2b04775 @janmarek updated readme
janmarek authored
31 $control->setMedia('screen');
0377250 @janmarek readme
janmarek authored
32
2b04775 @janmarek updated readme
janmarek authored
33 return $control;
0377250 @janmarek readme
janmarek authored
34 }
35
2b04775 @janmarek updated readme
janmarek authored
36 Template:
0377250 @janmarek readme
janmarek authored
37
2b04775 @janmarek updated readme
janmarek authored
38 {control css}
Something went wrong with that request. Please try again.