Download the PHP package devture/silex-asset-bundle without Composer

On this page you can find all versions of the php package devture/silex-asset-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 silex-asset-bundle

Asset Bundle

Provides asset linking.

Configuration example

Example for the article bundle data source:

"AssetBundle": {
    "allow_cdn": true,
    "asset_path": "/srv/http/example.com/web",
    "asset_url_prefix": ""
}

Initializing

$namespace = 'asset';
$app->register(new \Devture\Bundle\AssetBundle\ServicesProvider($asset, $this['config']['AssetBundle']));

All provided Twig functions will be prefixed with asset_ (the namespace used when registering).

Usage

Basic Asset Loading

Using the asset_url(LOCAL_FILE) function would generate a URL to the file. The file will be timestamped with its last-modification-time, for caching (cache-busting) purposes.

<script type='text/javascript' src='{{ asset_url('/js/jquery.min.js') }}'></script>

Result:

<script type='text/javascript' src='/js/jquery.min.js?1448329282'></script>

CDN-backed Asset Loading

Just like asset_url(LOCAL_FILE), you can use asset_url_with_cdn(LOCAL_FILE, CDN_MIRROR_URI) to specify a resource which is available both at the LOCAL_FILE path and at the CDN_MIRROR_URI URI.

Based on the allow_cdn configuration parameter (passed when registering the bundle), the appropriate URI will be used.

Example:

<script type='text/javascript'
    src='{{ asset_url('/js/jquery.min.js', 'https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js') }}'></script>

Result (if CDN usage is allowed in the configuration):

<script type='text/javascript' src='https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js'></script>

Result (if CDN usage is NOT allowed in the configuration):

<script type='text/javascript' src='/js/jquery.min.js?1448329282'></script>

If you rely on CDN-loading, you may also with to make use of Subresource Integrity, to ensure that the resource you're loading is the one you expect.

Example:

<script type='text/javascript'
    src='{{ asset_url('/js/jquery.min.js', 'https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js') }}'
    integrity="sha384-6ePHh72Rl3hKio4HiJ841psfsRJveeS+aLoaEf3BWfS+gTF0XdAqku2ka8VddikM"
    crossorigin="anonymous"></script>

All versions of silex-asset-bundle with dependencies

PHP Build Version
Package Version
Requires silex/silex 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 devture/silex-asset-bundle contains the following files

Loading the files please wait ....