Download the PHP package jmikola/js-assets-helper-bundle without Composer

On this page you can find all versions of the php package jmikola/js-assets-helper-bundle. 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 js-assets-helper-bundle

JmikolaJsAssetsHelperBundle

This bundle exposes the AssetsHelper service from Symfony2's templating component to JavaScript, which allows relative or absolute asset URI's to be generated client-side.

Compatibility

This bundle depends PR #2502, which is included in Symfony 2.0.5 and higher.

Configuration

If you do not configure the bundle explicitly, it will only expose the default package defined in the templating block of the FrameworkBundle configuration.

Named packages you wish to expose must be explicitly listed:

While an array of package names is the normal format, the configuration will also accept a scalar to expose a single package:

In these examples, "cloudfront" and "s3" correspond to named packages in the FrameworkBundle configuration. For example:

Additional information on configuring templating asset packages may be found in the FrameworkBundle docs.

Routing

The bundle defines one route to a dynamically generated JavaScript file. Ensure this route is including in your application's routing configuration:

Assets

The bundle includes a compiled JavaScript asset, which must be published to your web/ directory:

Include the compiled and dynamic JavaScript in your applications template:

Usage

Once configured, the bundle creates a single AssetsHelper global in JavaScript. This is modeled after the PHP class from Symfony2's Templating component and has the following methods:

Typically, you will want to use the getUrl() method to generate asset paths. Keep in mind that if you refer to a named package that has not been exposed, an InvalidPackageError will be thrown.

The following equivalent snippets demonstrate how AssetsHelper.getUrl() compares to Symfony2's asset helper for Twig:

Development

Note: This bundle includes a static JavaScript asset, which is pre-compiled with Google's Closure Compiler. Any changes to the static JavaScript will require that you recompile the asset. For your convenience, you may want to install JMSGoogleClosureBundle and use the following command:


All versions of js-assets-helper-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.2
symfony/dependency-injection Version >=2.0.5,<3.0-dev
symfony/framework-bundle Version ~2.0
symfony/twig-bundle Version ~2.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 jmikola/js-assets-helper-bundle contains the following files

Loading the files please wait ....