Download the PHP package elefant/app-assetic without Composer

On this page you can find all versions of the php package elefant/app-assetic. 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 app-assetic

This is an app for the Elefant CMS that pre-compiles and compresses Javascript and CSS using the Assetic library.

It also supports compiling the following formats

Installation

  1. Drop this app into your apps/ folder.
  2. Open the file apps/assetic/conf/config.php and set the paths to your compressors/compilers of choice (SASS, CoffeeScript, Handlebars, etc).

By default, it will use JSMinPlus for JavaScript compression and CSSMin for CSS compression. Other options include UglifyJS2/UglifyCSS, and YUI Compressor.

Usage

To use Assetic on a single script:

This will output something like:

Similarly, you can do the same with CSS files:

Will produce:

To use Assetic on several scripts or stylesheets at a time:

This will produce:

Note: Change myscripts to the name to use to save the cache file as. Otherwise, all.js will be used.

File lists can also be written over multiple lines, like this:

Recompiling later

To regenerate the scripts, log into Elefant and go to Tools > Assetic and click Recompile Assets. This will change the modification time on all templates, so that they are regenerated the next time they are run in the browser. The ?v= number will also regenerate so that browsers will automatically use the latest version at all times.

For development, you can also change the tags to use Elefant's {! !} tags instead, which will load the Assetic compilation process anew on each request:

It is smart enough to not regenerate the cache if the original files haven't changed, to reduce page load times during development.

How it works

The {# #} template tag will render the scripts the first time the layout is loaded and hard-code the resulting HTML into the template for subsequent requests, so the handler is only called the first time. This makes this plugin very fast for serving your optimized CSS and Javascript, since after the first load, the compiled scripts are called directly, bypassing the plugin entirely for subsequent requests.

You can achieve additional optimization by enabling GZIP output in your web server configuration.

Precompiling Handlebars templates

To precompile your Handlebars templates for faster execution on the client-side, which also includes only the much smaller Handlebars runtime without the compiler, follow these steps:

1. Save your Handlebars templates with a .handlebars file extension in your app's views folder. For example:

2. Include the following tag in your layout template to precompile them:

3. After the above include has compiled the templates, you can include them via:

This also includes the Handlebars runtime, minus the compiler, for you.

4. To call a template, simply refer to it like this:

Alternately, you can run the Handlebars compiler from the command line like this:

This replaces step 2 from the above, but note that you'll need to call it again whenever you modify a template, or run it with the --auto option to watch for template changes and automatically recompile them:


All versions of app-assetic with dependencies

PHP Build Version
Package Version
Requires elefant/app-installer Version *
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 elefant/app-assetic contains the following files

Loading the files please wait ....