Skip to content

Update twig render tag usage #142

Merged
merged 5 commits into from Jan 2, 2013

4 participants

@benja-M-1

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
Doctrine member
stof added a note Dec 21, 2012

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@stof
Doctrine 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) ?

@stof
Doctrine member
stof commented Dec 21, 2012

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

@fabpot
Doctrine 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).

@fabpot
Doctrine member
fabpot commented Dec 21, 2012

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

@fabpot
Doctrine 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.

@benja-M-1

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
Doctrine member
stof added a note Dec 21, 2012

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

@fabpot
Doctrine member
fabpot added a note Dec 21, 2012

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

@benja-M-1
benja-M-1 added a note Dec 21, 2012

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@XWB
XWB commented Jan 2, 2013

Ping @fabpot

@stof
Doctrine 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

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

Thanks!

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

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
Something went wrong with that request. Please try again.