PHPackages                             remiheens/smartloader - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. remiheens/smartloader

ActiveLibrary[Templating &amp; Views](/categories/templating)

remiheens/smartloader
=====================

Library to manage JS and CSS in template

2.0.x-dev(12y ago)213GPL-3.0+PHPPHP &gt;=5.3.0

Since Oct 30Pushed 12y ago1 watchersCompare

[ Source](https://github.com/remiheens/smartloader)[ Packagist](https://packagist.org/packages/remiheens/smartloader)[ Docs](http://github.com/remiheens/SmartLoader)[ RSS](/packages/remiheens-smartloader/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

SmartLoader
===========

[](#smartloader)

[![Latest Stable Version](https://camo.githubusercontent.com/4016a52fbdad8726fb75c8f08705ced3eb4609b0da82eab588498067872c311f/68747470733a2f2f706f7365722e707567782e6f72672f72656d696865656e732f736d6172746c6f616465722f76657273696f6e2e706e67)](https://packagist.org/packages/remiheens/smartloader)[![Total Downloads](https://camo.githubusercontent.com/6c29eecbff283f9163769ab603ed7eb0a7c8834ab6c0fc9a3d4b316996a4c6f5/68747470733a2f2f706f7365722e707567782e6f72672f72656d696865656e732f736d6172746c6f616465722f642f746f74616c2e706e67)](https://packagist.org/packages/remiheens/smartloader)[![Build Status](https://camo.githubusercontent.com/3749564f54b1de85fb203402b6d7007a977689e28248b15e9ae07013d9f1fba8/68747470733a2f2f7472617669732d63692e6f72672f72656d696865656e732f736d6172746c6f616465722e706e67)](https://travis-ci.org/remiheens/smartloader)

SmartLoader is a library that allows you to easily manage your js and css on your site.

When you have lot of js &amp; 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.

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.

Installation
------------

[](#installation)

Create `composer.json` file Add

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

```

Documentation
-------------

[](#documentation)

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

```
public function setTemplate($tpl);
```

set the template folder

```
public function getTemplate();
```

get the template folder

```
public function forceHTTP();
```

force http because by default output link starts woith "//domain.tld/..."

### JS

[](#js)

```
public function setTemplate($tpl);
```

set the template name, each js will be loaded into this directory template

```
public function forceHTTP();
```

force http because by default output link starts woith "//domain.tld/..."

```
public function add($args);
```

Add js file url or an array of url

```
public function loadLib($lib);
```

add a js library juste the name located in template\_folder/js/lib/ (see configuration).

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

Add jquery code in header or footer

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

Add javascript code in header or footer

```
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)

```
public function loadLinks();
```

Output the list of script balise for all js link added

```
public function loadJavascript($header = false);
```

Output javascript code

### CSS

[](#css)

```
public function setTemplate($tpl);
```

set the template name, each js will be loaded into this directory template

```
public function forceHTTP();
```

force http because by default output link starts woith "//domain.tld/..."

```
public function add($args);
```

Add css file url

```
public function output();
```

Output the link balise ref to css compiled file.

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

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4626d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0bc8ca9acdd7f5606091b579de2c6d9cb8a7bc189db7a0574b600135b2cac76a?d=identicon)[remiheens](/maintainers/remiheens)

---

Tags

cssJStemplate manager

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/remiheens-smartloader/health.svg)

```
[![Health](https://phpackages.com/badges/remiheens-smartloader/health.svg)](https://phpackages.com/packages/remiheens-smartloader)
```

###  Alternatives

[almasaeed2010/adminlte

AdminLTE - admin control panel and dashboard that's based on Bootstrap 4

45.5k8.8M145](/packages/almasaeed2010-adminlte)[rmrevin/yii2-minify-view

Yii2 View component with auto minification css &amp; js in runtime

185314.5k7](/packages/rmrevin-yii2-minify-view)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
