/php_assets_manager

micro assets manager for php

Primary LanguagePHPGNU General Public License v2.0GPL-2.0

php_assets_manager

##micro assets manager for php

Manage your cascade style sheet and javascript files with php assets manager create new package (css/javascript) add some files into package and in html render your package with one line Code.

How to include

  1. You need only assetsManager folder.
  2. Require AssetsManager.php file:
require_once('assetsManager/AssetsManager.php');

Usage

To use assets manager just need to edit assetsManager.php to define your assets packages

how to define a css package:

BundleConfig::add(
    (new BundleStyle("css/yourNameHere"))
            ->add('css/file1.css')
            ->add('css/file2.css')
            ->add('css/file3.css')
);

how to define a javascript package:

BundleConfig::add(
        (new BundleScript("js/yourNameHere"))
                ->add('js/file1.js')
                ->add('js/file2.js')
                ->add('js/file3.js')
);

how to render a package in html:

first you need to include AssetsManager.php file in html file:
include_once 'AssetsManager.php';
now call render function to render your css/javascript package:
echo BundleConfig::render("css/yourNameHere"); // Render your css package   
echo BundleConfig::render("js/yourNameHere"); // Render your javascript package