Download the PHP package dmlogic/assets without Composer

On this page you can find all versions of the php package dmlogic/assets. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package assets

Assets

ANOTHER static Asset manager package for PHP 5.3+

This one is designed to support the following workflow:

Installation

Install via Composer (dmlogic/assets) or

include 'Assets/Assets.php';
include 'Assets/StaticAsset.php';
include 'Assets/Script.php';
include 'Assets/Style.php';

use Dmlogic\Assets\Assets as Assets;

Installing to Laravel 4

Add the following to the 'require' section of your composer.json file.

"dmlogic/assets": "*"

Now run composer update.

You can then use the package immediately via the namespace e.g.

$myContainer = Dmlogic\Assets\Assets::container();

However, for easier usage, complete the following steps.

Add an Alias

Open the file app/config/app.php and add a line to the 'aliases' array:

'Assets' => 'Dmlogic\Assets\Assets'

You can now access the main class using

$myContainer = Assets::container();

Utilise cascading config files

Create an assets.php file in your app/config folder and add an array as described in the 'Generate Containers from text arrays' section below.

Then duplicate and adjust this file for your different environment folders.

Usage

The interface is a simplified form of the Laravel 3 Asset class. Create one or more containers, add assets to them and then render within a view.

Create new containers

This one will be called 'default'

$myContainer = Assets::container();

This one will be called 'home'

$homeContainer = Assets::container('home');

Add an asset

$myAsset = new Dmlogic\Assets\Style(array(
                                        'path'  => '/assets/css/bootstrap.css',
                                        'media' => 'screen'
                                     ))
$myContainer->add($myAsset);

Render the Container

<?= $myContainer->styles() ?>

and

<?= $myContainer->scripts() ?>

Create named container and add multiple assets in one command

$myAssets = array(

    new Dmlogic\Assets\Style(array(
                                'path'  => '/assets/css/bootstrap.css',
                                'media' => 'screen'
                             )),

    new Dmlogic\Assets\Style(array(
                                'path'  => '/assets/css/print.css',
                                'media' => 'print'
                             )),

    new Dmlogic\Assets\Script(array(
                                'path' => '/assets/js/bootstrap.js',
                              ))

    new Dmlogic\Assets\Script(array(
                                'inline' => 'console.log("useful, huh?")'
                              ))
);

Assets::container('home')->add($myAssets);

Render assets from named Container

echo Assets::container('home')->styles();

echo Assets::container('home')->scripts();

Generate Containers from text arrays

One of the most likely uses of this package is to define your containers in config files that vary per environment. A method createContainer() is available to make this a simple process. It accepts two parameters, a config array in the format described here and the name of the container.

$containers = include '/config/packages/[your_environment]/assets.php';

$defaultAssets = Assets::createContainer( $containers['default'] );

$homeAssets = Assets::createContainer( $containers['home'], 'home' );

Roadmap


All versions of assets with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dmlogic/assets contains the following files

Loading the files please wait ....