2017 © Pedro Peláez
 

symfony-bundle custom-assets-bundle

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

image

adrenalinkin/custom-assets-bundle

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

  • Tuesday, March 20, 2018
  • by adrenalinkin
  • Repository
  • 1 Watchers
  • 0 Stars
  • 16 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

Custom Assets Bundle На Русском

Introduction

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., (*1)

Installation

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:, (*2)

    composer require adrenalinkin/custom-assets-bundle

This command requires you to have Composer install globally., (*3)

Step 2: Enable the Bundle

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

<?php
// 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:, (*5)

{
    "scripts": {
        "post-root-package-install": [
            "SymfonyStandard\\Composer::hookRootPackageInstall"
        ],
        "symfony-scripts": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",

            "Linkin\\Bundle\\CustomAssetsBundle\\Composer\\ScriptHandler::installCustomAssets",

            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
        ],
        "post-install-cmd": [
            "@symfony-scripts"
        ],
        "post-update-cmd": [
            "@symfony-scripts"
        ]
    }
}

Configuration

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:, (*6)

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

More information about configuration and configuration file in the part Configuration description., (*7)

Usage

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., (*8)

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

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

Commands

License

license, (*10)

The Versions

20/03 2018

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

 

by Viktor Linkin

assets yaml symfony-bundle custom-assets

20/03 2018

v1.1.0

1.1.0.0

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

  Sources   Download

MIT

The Requires

 

by Viktor Linkin

assets yaml symfony-bundle custom-assets

06/12 2017

v1.0.4

1.0.4.0

This bundle provides creating assets from the custom sources. Work like an assets:install

  Sources   Download

MIT

The Requires

 

by Viktor Linkin

symfony2 bundle assets folder custom-assets

30/11 2017

v1.0.3

1.0.3.0

This bundle provides creating assets from the custom sources. Work like an assets:install

  Sources   Download

MIT

The Requires

 

by Viktor Linkin

symfony2 bundle assets folder custom-assets

22/11 2017

v1.0.2

1.0.2.0

This bundle provides creating assets from the custom sources. Work like an assets:install

  Sources   Download

MIT

The Requires

 

by Viktor Linkin

symfony2 bundle assets folder custom-assets

15/11 2017

v1.0.1

1.0.1.0

This bundle provides creating assets from the custom sources. Work like an assets:install

  Sources   Download

MIT

The Requires

 

by Viktor Linkin

symfony2 bundle assets folder custom-assets

26/07 2017

v1.0.0

1.0.0.0

This bundle provides creating assets from the custom sources. Work like an assets:install

  Sources   Download

MIT

The Requires

 

by Viktor Linkin

symfony2 bundle assets folder custom-assets