Skip to content

Komponenta pro Nette Framework načítající skripty a styly

Notifications You must be signed in to change notification settings

pesektomas/WebLoader

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebLoader
=========

Component for CSS and JS files loading

Author: Jan Marek
Licence: MIT

Example:

	<?php

	// presenter factory in nette

	protected function createComponentCss()
	{
		$files = new WebLoader\FileCollection(WWW_DIR . '/css');
		$files->addFiles(array(
			'style.css',
			WWW_DIR . '/colorbox/colorbox.css',
		));

		$compiler = WebLoader\Compiler::createCssCompiler($files, WWW_DIR . '/temp');

		$compiler->addFilter(new WebLoader\Filter\VariablesFilter(array('foo' => 'bar'));
		$compiler->addFilter(function ($code) {
			return cssmin::minify($code, "remove-last-semicolon");
		});

		$control = new WebLoader\Nette\CssLoader($compiler, '/webtemp');
		$control->setMedia('screen');

		return $control;
	}

Template:

	{control css}

About

Komponenta pro Nette Framework načítající skripty a styly

Resources

Stars

Watchers

Forks

Packages

No packages published