Update twig render tag usage #142

Merged
merged 5 commits into from Jan 2, 2013

Projects

None yet

4 participants

Contributor

fix #141

@stof stof commented on an outdated diff Dec 21, 2012
DependencyInjection/DoctrineExtension.php
@@ -50,6 +50,9 @@ public function load(array $configs, ContainerBuilder $container)
if (!empty($config['orm'])) {
$this->ormLoad($config['orm'], $container);
}
+
+ $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
+ $loader->load('profiler.xml');
stof
stof Dec 21, 2012 Member

Why a separate file ? Put this in dbal.xml (where the DBAL data collector is also registered)

Member
stof commented Dec 21, 2012

btw, why defining the controller as service whereas it was not written to be used this way (the class does not follow the DI pattern) ?

Member
stof commented Dec 21, 2012

@fabpot would this continue working in Symfony 2.1 or do we need separate branches ?

Member
fabpot commented Dec 21, 2012

You cannot use the same code for Symfony 2.1 and master as the render tag has a different method signature (when you need to pass options).

Member
fabpot commented Dec 21, 2012

ok, let me see if we can make the render tag works for both versions.

Member
fabpot commented Dec 21, 2012

Ok, as of now, you can use the same code for both Symfony 2.1 and master:

{% render url('foo') with {}, {'bar': 1} %}

where the empty array is just ignored in master.

Contributor

I'll try that

@stof stof and 2 others commented on an outdated diff Dec 21, 2012
Resources/views/Collector/db.html.twig
'token': token,
'panel': 'db',
'connectionName': app.request.query.get('connection'),
'query': app.request.query.get('query')
- } %}
+ }) with {} %}
stof
stof Dec 21, 2012 Member

is it mandatory to pass the with part when it is empty ?

fabpot
fabpot Dec 21, 2012 Member

no, it's only required when you need to also pass options.

benja-M-1
benja-M-1 Dec 21, 2012 Contributor

Removing the ẁith part from the render tag does raise an error, doesn't it?

Contributor
XWB commented Jan 2, 2013

Ping @fabpot

Member
stof commented Jan 2, 2013

Merging it. As @benja-M-1 has not commented after doing the requested change, I have not been notified it was ready

@stof stof merged commit f1ddf37 into doctrine:master Jan 2, 2013

1 check passed

default The Travis build passed
Details
Contributor
XWB commented Jan 2, 2013

Thanks!

@benja-M-1 benja-M-1 deleted the benja-M-1:patch-profiler branch Jan 2, 2013
Contributor

Ha oops my bad... sorry. Thanks btw

@stof stof added a commit that referenced this pull request Jan 12, 2013
@stof stof Revert "Merge pull request #142 from benja-M-1/patch-profiler"
This reverts commit f1ddf37, reversing
changes made to 2991d0d.
2483d35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment