2017 © Pedro PelĂĄez
 

library smartloader

Library to manage JS and CSS in template

image

remiheens/smartloader

Library to manage JS and CSS in template

  • Wednesday, October 30, 2013
  • by remiheens
  • Repository
  • 1 Watchers
  • 3 Stars
  • 8 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

SmartLoader

Latest Stable Version Total Downloads Build Status, (*1)

SmartLoader is a library that allows you to easily manage your js and css on your site., (*2)

When you have lot of js & css to include dynamically, it’s difficult and complex. With SmartLoader, you have some functions to enqueue code or links in controllers and you just have to output the queue in your footer., (*3)

If you know wordpress development, this library works like the wp_enqueue function. In your controller, you can enqueue some js and css link, and output this in footer., (*4)

Installation

Create composer.json file Add, (*5)

{
    "require": {
        "remiheens/smartloader": "2.0.*@dev"
    }
}

Documentation

The object "SmartLoader" has two objects: "js" and "css", these two attributes are the managers for CSS and Javascript., (*6)

public function setTemplate($tpl);

set the template folder, (*7)

public function getTemplate();

get the template folder, (*8)

public function forceHTTP();

force http because by default output link starts woith "//domain.tld/...", (*9)

JS

public function setTemplate($tpl);

set the template name, each js will be loaded into this directory template, (*10)

public function forceHTTP();

force http because by default output link starts woith "//domain.tld/...", (*11)

public function add($args);

Add js file url or an array of url, (*12)

public function loadLib($lib);

add a js library juste the name located in template_folder/js/lib/ (see configuration)., (*13)

public function jquery($data, $header = false);

Add jquery code in header or footer, (*14)

public function js($data, $header = false);

Add javascript code in header or footer, (*15)

public function load($js_file);

load a js like a view, SmartLoaderJS try to get this file into the configurated js folder (name without .js), (*16)

public function loadLinks();

Output the list of script balise for all js link added, (*17)

public function loadJavascript($header = false);

Output javascript code, (*18)

CSS

public function setTemplate($tpl);

set the template name, each js will be loaded into this directory template, (*19)

public function forceHTTP();

force http because by default output link starts woith "//domain.tld/...", (*20)

public function add($args);

Add css file url, (*21)

public function output();

Output the link balise ref to css compiled file., (*22)

Each CSS added + autoload folder are concatenated to a css file into compiled folder. It wil be regenerated if on file are modify, (*23)

The Versions

30/10 2013

dev-master

9999999-dev http://github.com/remiheens/SmartLoader

Library to manage JS and CSS in template

  Sources   Download

GPL-3.0+

The Requires

  • php >=5.3.0

 

The Development Requires

css js template manager

30/10 2013

2.0.x-dev

2.0.9999999.9999999-dev http://github.com/remiheens/SmartLoader

Library to manage JS and CSS in template

  Sources   Download

GPL-3.0+

The Requires

  • php >=5.3.0

 

The Development Requires

css js template manager