2017 © Pedro Peláez
 

symfony-bundle assets-referencer-bundle

Assets referencer bundle for Symfony

image

betsol/assets-referencer-bundle

Assets referencer bundle for Symfony

  • Thursday, July 3, 2014
  • by s.fomin
  • Repository
  • 1 Watchers
  • 1 Stars
  • 346 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 14 % Grown

The README.md

AssetsReferencerBundle

Description

This bundle will provide you with Twig function, that can be used to reference assets, i.e. CSS, JavaScript and image files from inside your templates., (*1)

You will be able to change base URL of the assets by a single configuration option., (*2)

Features

  • Allows you to define assets in your Twig templates in a consistent way
  • Provides you with the ability to change base URL of all your assets in one place

Installation

Install library with Composer

composer require betsol/assets-referencer-bundle ~1.0, (*3)

Add bundle to your application's kernel

``` php // app/AppKernel.php, (*4)

class AppKernel extends Kernel { public function registerBundles() { $bundles = array( ... new Betsol\Bundle\AssetsReferencerBundle\AssetsReferencerBundle, );, (*5)

    ...
}

}, (*6)


### Introduce bundle configuration to your config file ``` yaml # app/config/config.yml assets_referencer: base_url: http://static.example.com/

Usage

Use asset_reference function in your Twig templates to specify paths for your assets., (*7)

{# Favicon #}
<link rel="icon" href="{{ asset_reference('favicon.ico') }}">

{# Stylesheet #}
<link href="{{ asset_reference('css/index.css') }}" rel="stylesheet">

{# JavaScript #}


{# Image #}
<img src="{{ asset_reference('images/logo.png') }}" alt="Logotype">

API

See the examples above., (*8)

Feedback

If you have found a bug or have another issue with the library - please create an issue in this GitHub repository., (*9)

If you have a question - file it with StackOverflow and send a link to my E-Mail address. I will be glad to help., (*10)

Have any ideas or propositions? Feel free to contact me., (*11)

Cheers!, (*12)

License

The MIT License (MIT), (*13)

Copyright (c) 2014 Better Solutions, Slava Fomin II s.fomin@betsol.ru, (*14)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:, (*15)

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software., (*16)

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE., (*17)

The Versions

03/07 2014

dev-master

9999999-dev

Assets referencer bundle for Symfony

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Slava Fomin II

03/07 2014

v1.0.0

1.0.0.0

Assets referencer bundle for Symfony

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Slava Fomin II