Commit Graph

227 Commits

Author SHA1 Message Date
Victor Berchet
e254ff8cc6 Display template logical names in exception messages 2011-04-08 19:56:12 +02:00
Fabien Potencier
a230090537 removed some json_encode() calls to use the new getLogicalName() method instead 2011-04-08 17:28:27 +02:00
Victor Berchet
b640fcb0f0 [Config] Introduction of an ConfigurationInterface 2011-04-05 11:26:28 +02:00
Ryan Weaver
22beeb2549 [TwigBundle] Cleaning up several portions of the exception message received when a template cannot be loaded
* The quotations are redundant when the template is a string - json_encode() adds the quotes
 * The exception should not end in a period, as the exception class may add a line number (not in this case, but generall)
 * Made the line number -1, so that no line number was displayed in the message (error at line 0 looks worse than nothing at all)
2011-04-04 21:35:00 -05:00
Fabien Potencier
dd150fc478 Merge remote branch 'vicb/twig_warmer'
* vicb/twig_warmer:
  [TwigBundle] Update the cache warmer
2011-04-04 18:52:56 +02:00
Fabien Potencier
f232b3cdda reverted Merge remote branch 'kriswallsmith/kernel/shorter-bundle-names' 2011-04-04 11:10:56 +02:00
Fabien Potencier
743592d81e Revert "fixed remaining Bundle suffixes"
This reverts commit 315147c6c8.
2011-04-04 11:08:56 +02:00
Victor Berchet
95f5ba1ccd [TwigBundle] Update the cache warmer 2011-03-28 22:04:39 +02:00
Fabien Potencier
315147c6c8 fixed remaining Bundle suffixes 2011-03-28 19:04:02 +02:00
Fabien Potencier
49063a5314 Merge remote branch 'kriswallsmith/kernel/shorter-bundle-names'
* kriswallsmith/kernel/shorter-bundle-names:
  updated codebase to use shorter bundle names
  [HttpKernel] updated component to work with shorter bundle names
  [HttpKernel] updated Bundle::getName() to validate bundle class name and rtrim "Bundle"
2011-03-28 18:06:41 +02:00
Fabien Potencier
faf9782e6f renamed Twig TransExtension to TranslationExtension 2011-03-28 16:16:54 +02:00
Kris Wallsmith
ade83e2e80 updated codebase to use shorter bundle names
Controllers:
"BlogBundle:Post:show" is now "Blog:Post:show"

Templates:
"BlogBundle:Post:show.html.twig" is now "Blog:Post:show.html.twig"

Resources:
"@BlogBundle/Resources/config/blog.xml" is now "@Blog/Resources/config/blog.xml"

Doctrine:
"$em->find('BlogBundle:Post', $id)" is now "$em->find('Blog:Post', $id)"
2011-03-27 06:25:43 -07:00
Fabien Potencier
82dec51b30 moved integration between the Yaml component and Twig to a Symfony Bridge 2011-03-23 15:50:55 +01:00
Fabien Potencier
e912b347f0 moved integration between the Translation component and Twig to a Symfony Bridge 2011-03-23 15:23:52 +01:00
Fabien Potencier
3e5bd67dac moved integration between Routing and Twig to a Symfony Bridge 2011-03-23 15:16:57 +01:00
Miha Vrhovnik
e57075ea60 removed unused and undefined namespace and use statement 2011-03-21 10:50:13 +01:00
Fabien Potencier
2d9ae36119 Merge remote branch 'vicb/one_more_thing' 2011-03-18 16:32:35 +01:00
Fabien Potencier
0c8ff92ecd made the controller name in the WDT clickable 2011-03-18 16:09:21 +01:00
Victor Berchet
d959a3ed4b [TwigBundle] Rename the cache warmer service 2011-03-18 15:48:34 +01:00
Fabien Potencier
c5a6c8432f Merge remote branch 'vicb/templating' 2011-03-18 11:54:20 +01:00
Victor Berchet
f89a5ff3b8 [TwigBundle] Fix some typos 2011-03-18 11:30:23 +01:00
Victor Berchet
7f523466f4 [TwigBundle] Fix the cache warmer 2011-03-18 11:23:23 +01:00
Christophe Coevoet
2743abc35d [DoctrineBundle] Fix some typos 2011-03-17 23:14:18 +01:00
Victor Berchet
0e84757d94 Tweak PHPDocs in the extension configuration files 2011-03-17 16:29:03 +01:00
Victor Berchet
1e0ed22c55 [Config] Component refactoring
The Config component API have changed and the extension configuration files must be updated accordingly:

1. Array nodes must enclosed their children definition in ->children() ... ->end() calls:

Before:

    $treeBuilder->root('zend', 'array')
        ->arrayNode('logger')
            ->scalarNode('priority')->defaultValue('INFO')->end()
            ->booleanNode('log_errors')->defaultFalse()->end()
        ->end();

After:

    $treeBuilder->root('zend', 'array')
        ->children()
            ->arrayNode('logger')
                ->children()
                    ->scalarNode('priority')->defaultValue('INFO')->end()
                    ->booleanNode('log_errors')->defaultFalse()->end()
                ->end()
            ->end()
        ->end();

2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition)

Before:

    $treeBuilder->root('doctrine', 'array')
        ->arrayNode('dbal')
            ->builder($this->getDbalConnectionsNode())
        ->end();

After:

    $treeBuilder->root('doctrine', 'array')
        ->children()
            ->arrayNode('dbal')
                ->append($this->getDbalConnectionsNode())
            ->end()
        ->end();

3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition):

Before:

    $root = $treeBuilder->root('doctrine', 'array');
    $this->addDbalSection($root);

    public function addDbalSection(NodeBuilder $node)
    {
        ...
    }

After:

    $root = $treeBuilder->root('doctrine', 'array');
    $this->addDbalSection($root);

    public function addDbalSection(ArrayNodeDefinition $node)
    {
        ...
    }

4. The NodeBuilder API has changed (this is seldom used):

Before:

    $node = new NodeBuilder('connections', 'array');

After:

The recommended way is to use a tree builder:

    $treeBuilder = new TreeBuilder();
    $node = $treeBuilder->root('connections', 'array');

An other way would be:

    $builder = new NodeBuilder();
    $node = $builder->node('connections', 'array');

Some notes:

- Tree root nodes should most always be array nodes, so this as been made the default:

    $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine')

- There could be more than one ->children() ... ->end() sections. This could help with the readability:

    $treeBuilder->root('doctrine')
        ->children()
            ->scalarNode('default_connection')->end()
        ->end()
        ->fixXmlConfig('type')
        ->children()
            ->arrayNode('types')
                ....
            ->end()
        ->end()
2011-03-17 16:26:15 +01:00
Fabien Potencier
005287ac88 Merge remote branch 'kriswallsmith/templating/asset-packages' 2011-03-16 16:18:45 +01:00
Christophe Coevoet
61abc3d01f Added the global variable in PHP templates too 2011-03-16 13:11:29 +01:00
Fabien Potencier
539e0e4870 Merge remote branch 'mweimerskirch/master' 2011-03-14 14:38:00 +01:00
Don Pinkster
f8493842d3 [TwigBundle] Fixed PHPDoc 2011-03-11 22:44:32 +01:00
Don Pinkster
c4923fc57e [TwigBundle] Fixed typo 2011-03-11 22:39:47 +01:00
Kris Wallsmith
7d9ddb546e [TwigBundle] updated to support asset packages 2011-03-08 09:24:43 -08:00
Fabien Potencier
8c423edfef replaced symfony-project.org by symfony.com 2011-03-06 12:40:06 +01:00
Pascal Borreli
19f931a231 [TwigBundle] Fixed Typo 2011-03-01 18:58:07 +01:00
Christophe Coevoet
92bfbf575c Fixed CS 2011-02-27 20:56:29 +01:00
Pascal Borreli
0c9951f676 [TwigBundle] Fixed typo 2011-02-26 20:02:05 +01:00
Michel Weimerskirch
6998e593e0 Added line number to TransChoiceTokenParser exception message (TwigBundle). 2011-02-24 06:47:45 -08:00
Fabien Potencier
79bc233344 [TwigBundle] fixed typo 2011-02-24 09:46:59 +01:00
Fabien Potencier
d94acd85f9 remove response as a service
The Response is not available in the DIC anymore.

When you need to create a response, create an instance of
Symfony\Component\HttpFoundation\Response instead.

As a side effect, the Controller::createResponse() and Controller::redirect()
methods have been removed and can easily be replaced as follows:

  return $this->createResponse('content', 200, array('foo' => 'bar'));
  return new Response('content', 200, array('foo' => 'bar'));

  return $this->redirect($url);
  return Response::createRedirect($url);
2011-02-21 17:36:04 +01:00
Fabien Potencier
23e9386a0e changed all extensions to use the default Extension::getAlias() impl 2011-02-20 08:58:37 +01:00
Jeremy Mikola
f4c0af76e7 [TwigBundle] Allow arbitrary variables to be accepted as values for globals
This fixes a regression introduced when TwigExtension was refactored to utilize the Config component.
2011-02-20 00:59:18 -05:00
Fabien Potencier
d6c277f5c4 Merge remote branch 'stof/escaping'
* stof/escaping:
  Fixed escaping for arguments
2011-02-19 18:50:32 +01:00
Fabien Potencier
f6e624b1e2 [TwigBundle] changed all Boolean to string in XSD as you might want to use a parameter %...% 2011-02-19 15:36:41 +01:00
Fabien Potencier
4833acf301 Merge remote branch 'opensky/TwigExtension-configuration'
* opensky/TwigExtension-configuration:
  [TwigBundle] Refactored TwigExtension class and implemented configuration tree
2011-02-19 15:35:09 +01:00
Fabien Potencier
946d3d9302 fixed previous commit 2011-02-19 13:02:23 +01:00
benjamindulau
f1dd3f22e3 [TwigBundle] adding two global variables : environment & debug + some doc blocks
Use case :
    {% if app.environment == 'prod' %}
        {# e.g google analytics scripts #}
    {% endif %}
2011-02-19 13:00:51 +01:00
Jeremy Mikola
f0d2ce7f32 [TwigBundle] Refactored TwigExtension class and implemented configuration tree
Added config fixtures in each format to demonstrate the possible styles of all of the extension options. These should all be covered by the updated tests. Made XSD slightly more restrictive, with regards to the "type" attribute on globals. This is coupled with validation in the configuration class.
2011-02-18 12:58:04 -05:00
Jordi Boggiano
38813c122e [TwigBundle] Resolve some TODOs in form templates 2011-02-17 16:00:28 +01:00
Bernhard Schussek
14c3518c6e [Form] Fixed: If a DateField or TimeField is displayed with select boxes, either all or no select box must have a value selected 2011-02-16 23:05:22 +01:00
Fabien Potencier
62e3053769 refactored previous commit, fixed tests
How to upgrade?

For XML configuration files:

 * All extensions should now use the config tag (this is just a convention as
   the YAML configurations files do not use it anymore):

 * The previous change means that the doctrine and security bundles now are
   wrapped under a main "config" tag:

        <doctrine:config>
            <doctrine:orm />
            <doctrine:dbal />
        </doctrine:config>

        <security:config>
            <security:acl />
            ...
        </security:config>

For YAML configuration files:

 * The main keys have been renamed as follows:

        * assetic:config -> assetic
        * app:config -> framework
        * webprofiler:config -> web_profiler
        * doctrine_odm.mongodb -> doctrine_mongo_db
        * doctrine:orm -> doctrine: { orm: ... }
        * doctrine:dbal -> doctrine: { dbal: ... }
        * security:config -> security
        * security:acl -> security: { acl: ... }
        * twig.config -> twig
        * zend.config -> zend
2011-02-15 22:22:28 +01:00
Lukas Kahwe Smith
7f182bd877 implicitly load all registered bundles, all loading is now handled by load(), disable loading of an extension explcitly via setting the extension config to false (for now only Yaml is implemented) 2011-02-15 22:11:08 +01:00