This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

Provides creating assets from the custom sources. Work like an assets:install

v1.1.0 2018-03-20 18:40 UTC

This package is auto-updated.

Last update: 2021-10-08 19:56:45 UTC



Bundle allows transfer required assets from the custom folders into public directory. Business logic similar to standard Symfony command - assets:install. Also required YAML-configuration, which register one or more path to the custom sources. After installation sources will be transfer into custom_assets folder under public part of the project.


Step 1: Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

    composer require adrenalinkin/custom-assets-bundle

This command requires you to have Composer install globally.

Step 2: Enable the Bundle

Then, enable the bundle by updating your app/AppKernel.php file to enable the bundle:

// app/AppKernel.php

class AppKernel extends Kernel
    // ...

    public function registerBundles()
        $bundles = [
            // ...

            new Linkin\Bundle\CustomAssetsBundle\LinkinCustomAssetsBundle(),

        return $bundles;

    // ...

Step 3: Run command by Composer

Register the script in composer.json for call custom assets installation every time when composer requirements has been install/update. To provide this behaviour add string "Linkin\\Bundle\\CustomAssetsBundle\\Composer\\ScriptHandler::installCustomAssets", after standard installAssets call. Example:

    "scripts": {
        "post-root-package-install": [
        "symfony-scripts": [


        "post-install-cmd": [
        "post-update-cmd": [


To start using Bundle your need to create configuration in the global project configuration app/config/config.yml or register configuration in the custom_assets.yml in the any bundle of you project. Simple configuration, which should transfer Bootstrap asset:

        bootstrap_dir: '../vendor/twbs/bootstrap/dist'

More information about configuration and configuration file in the part Configuration description.


Usage example expect using simple configuration from the previous part. After run the command custom_assets:install assets from folder vendor/twbs/bootstrap/dist will be transfer into public folder of you project and will be available from the web/custom_assets/bootstrap_dir.

Thus you you can access to the required filed, for example bootstrap.min.css:

    <link type="text/css" rel="stylesheet" href="{{ asset('custom_assets/bootstrap_dir/css/bootstrap.min.css') }}">