2017 © Pedro Peláez
 

symfony-bundle config-to-js-bundle

Provides a command to dump defined config to js file

image

dawen/config-to-js-bundle

Provides a command to dump defined config to js file

  • Thursday, February 4, 2016
  • by dawen
  • Repository
  • 0 Watchers
  • 1 Stars
  • 6,284 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

config-to-js-bundle

Build Status, (*1)

Provides a command to dump defined config to js file., (*2)


Installation

Step 1: Composer

Required in composer.json, (*3)

   "dawen/config-to-js-bundle": "~1.0"

Run composer update dawen/config-to-js-bundle after modifiering composer.json file., (*4)

Step 2: AppKernel

In your app/config/AppKernel.php file you should activate the bundle by adding it to the array, (*5)

    $bundles[] = new Dawen\Bundle\ConfigToJsBundle\ConfigToJsBundle();

Step 3: Configuration

    config_to_js:
      type: 'module'
      output_path: '%kernel.root_dir%/../web/js/app-config.js'
      config:
        imageLocation: 'http://this-is-an-example.com/images'
        appVersion: '1.1.0'

If parameter are not defined, default values will be applied., (*6)

Step 4: Run the command

Go to your console and run, (*7)

    bin/console config:js:dump

Configuration Parameter Description

type:, (*8)

possible values: module default value: module description: This defines for what the dumped code is optimized., (*9)

output_path:, (*10)

possible values: a valid string for a filepath default value: null description: This parameter defines a path and filename that will be created. If this value is not set, the dumper will throw an error., (*11)

config:, (*12)

possible values: array default value: empty array description: Here you can create you config vars that should be availabe on your javascript side., (*13)


Supported Types/Renderers

module: Your file is includeable by module pattern like this: import appConfig from './ccurrent-folder/web/js/app-config.js', (*14)

The Versions

04/02 2016

dev-master

9999999-dev

Provides a command to dump defined config to js file

  Sources   Download

MIT

The Requires

 

The Development Requires

by Daniel Wendlandt

config javascript bundle symfony dump

04/02 2016

1.0.0

1.0.0.0

Provides a command to dump defined config to js file

  Sources   Download

MIT

The Requires

 

The Development Requires

by Daniel Wendlandt

config javascript bundle symfony dump