Skip to content

Commit

Permalink
Docs about LoaderBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikbjorn committed Jul 28, 2014
1 parent b2405d6 commit 4394c19
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,27 @@ Getting Started
$configurator = new Configurator($loader);
$configurator->configure(new Container, 'config.json');
Fortunately there exists a better way of doing all of this.

.. code-block:: php
<?php
use Tacker\LoaderBuilder;
$loader = LoaderBuilder::create($paths)
->build()
;
$configurator = new Configurator($loader);
$configurator->configure($container, 'config.json');
The LoaderBuilder will try and setup sane defaults. Which means all the loaders for php, ini, json and yml if
``Symfony\Component\Yaml\Yaml`` is available.

The builder contains methods for cofiguring the different parts, but configuring normalizers or loaders will
remove the default unless you call ``$builder->addDefaultNormalizers()`` and ``$builder->addDefaultLoaders()``.

Inheriting
~~~~~~~~~~

Expand Down

0 comments on commit 4394c19

Please sign in to comment.