PHPackages                             crecket/dependency-manager - 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. crecket/dependency-manager

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

crecket/dependency-manager
==========================

Resource dependency manager

3.4(9y ago)098[1 issues](https://github.com/Crecket/dependency-manager/issues)WTFPLPHP

Since Jan 24Pushed 9y ago1 watchersCompare

[ Source](https://github.com/Crecket/dependency-manager)[ Packagist](https://packagist.org/packages/crecket/dependency-manager)[ Docs](https://github.com/Crecket/dependency-manager)[ RSS](/packages/crecket-dependency-manager/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (16)Used By (0)

dependency-manager
==================

[](#dependency-manager)

[![Build Status](https://camo.githubusercontent.com/41809d671222d4e1ac79f92a4b6a8cebb0f0e492007fe686ef1fd92627b4220e/68747470733a2f2f7472617669732d63692e6f72672f437265636b65742f646570656e64656e63792d6d616e616765722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Crecket/dependency-manager) [![Latest Release](https://camo.githubusercontent.com/49fdc72198e88b6ec8f3334b82650dc0033a72985d096191b1355d77520a4b19/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f637265636b65742f446570656e64656e63792d6d616e616765722e737667)](https://github.com/Crecket/dependency-manager)

Introduction
------------

[](#introduction)

A simple and small dependency manager for javascript and CSS files. All files will be combined, minified and cached. Less and Scss files are also supported and all css output is run through a auto-prefixer.

Requirements
------------

[](#requirements)

```
- matthiasmullie/minify ^1.3
- doctrine/cache ^1.6
- leafo/scssphp ^0.6.3
- tedivm/jshrink ^1.1
- leafo/lessphp ^0.5.0
- twig/twig ^1.23
- css-crush/css-crush ^dev-master

```

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

[](#installation)

1. Install with composer

    `composer require crecket/dependency-manager`
2. Add the twig extension to your twig view:

    `$twig->addExtension(new Crecket\DependencyManager\Response());`

Usage
-----

[](#usage)

### Adding new files

[](#adding-new-files)

##### addFiles($fileList, $groupName);

[](#addfilesfilelist-groupname)

- PARAM1: enter a single string to a file location or a array with multiple files.
- PARAM2: the group name, this way you can store multiple file groups

```
use Crecket\DependencyManager\Loader;
Loader::addFiles('testFile.css', 'cssGroupName');

// different group and multiple files this time
Loader::addFiles(array('testFile.css', '/some/folder/file_name.css'), 'cssGroupName2');

```

### Remove files

[](#remove-files)

##### removeFiles($groupName);

[](#removefilesgroupname)

- PARAM1: contains the file group name.

```
Loader::removeFiles('cssGroupName2');

```

### Create a url

[](#create-a-url)

##### Twig: getFilesLink(minify, groupName)

[](#twig-getfileslinkminify-groupname)

- PARAM1: Minify the files or not
- PARAM2: Group name

```

```

##### PHP: getFilesLink(

[](#php-getfileslink)

- PARAM1: Minify the files or not
- PARAM2: Group name

```
