Questions tagged [symfony-2.2]

This is the Symfony 2.2.x specific tag. Use it in addition to the symfony2 tag if your question is specific to Symfony 2.2.x — not just 2.x.

Symfony is a PHP full-stack web framework developed and maintained by Sensio Labs.

Information

This tag is specific for the 2.2 version of Symfony, which has been released on the 1 March 2013. See the tag for general Symfony 2.x questions.

As of 19 June 2013, the latest stable release of Symfony 2.2 is version 2.2.3.

Living on the edge

There are a set of interesting links on the symfony blog about what's new in this version:

Useful links

190 questions
62
votes
3 answers

What is the Symfony firewall doing that takes so long?

My Symfony page isn't too slow (it loads in about 400 ms) but considering the fact that it's just a simple hello world page with basic authentication, it should be loading in less than 100 ms. When I enter the profiler, I see this: Notice it just…
Hubro
  • 56,214
  • 69
  • 228
  • 381
34
votes
1 answer

How to insert a Controller in Twig with "render" in Symfony 2.2?

I'm upgrading my project from Symfony 2.0.22 to 2.2.0 and review somes changes, but i'm blocked on this : I would like to render (like in Sf 2.0.X) a header with their controller and the "render" twig method don't work for me. Their is the error…
Benji_X80
  • 495
  • 1
  • 7
  • 12
32
votes
2 answers

Check if ArrayCollection is empty

I have an Entity Order which hold Suppliers in an Arraycollection. In my controller i want to check if this arraycollection is empty: $suppliers = $order->getSuppliers(); I tried: if(!($suppliers)) {} if(empty($suppliers)) {} Any ideas?
ChrisS
  • 736
  • 2
  • 8
  • 21
30
votes
3 answers

Symfony2 -> Twig -> Form -> Field -> Set rendered = true

i have a simple problem. I have a form with a field for example: $builder ->add('x') ->add('y') ->add('z') ; In my twig files i used multiple blocks and i want to stop render fields... I view the b.html.twig file! a.html.twig {% block…
PatrickB
  • 3,225
  • 5
  • 31
  • 55
26
votes
5 answers

SonataAdminBundle : display non crud (statistics)

I'm using sonata admin bundle to generate my backend, I'm so happy with it that I would like to use my backend to display statistics as well. I guess I can do that by tweaking bundle's views, "standard_layout.html.twig" maybe. Problem is, I can't…
copndz
  • 1,104
  • 2
  • 12
  • 23
17
votes
5 answers

Logging swiftmailer send() activity in symfony2

Im using swiftmailer for sending mails from my symfony2.2 project. Is there a way to log globally all email info and send results? It would be great if mailer send() method have trigger somę event, but I can't see it does.
tiriana
  • 668
  • 1
  • 7
  • 24
15
votes
1 answer

Symfony2 demo testing issues

I just installed the last version of phpunit and when I run the demo test with: bin/phpunit src/Acme/DemoBundle/Tests/ I get this problems: 1) Acme\DemoBundle\Tests\Controller\DemoControllerTest::testIndex RuntimeException: Unable to guess the…
Nico Rodsevich
  • 2,393
  • 2
  • 22
  • 32
14
votes
1 answer

symfony2 how to upload file without doctrine?

Is it possible to upload files in symfony2 WITHOUT using doctrine? With doctrine, its example is given here: http://symfony.com/doc/2.2/cookbook/doctrine/file_uploads.html Is there a simple way to upload files, like in core PHP we have…
Rahul
  • 2,189
  • 7
  • 40
  • 60
14
votes
3 answers

Build a form having a checkbox for each entity in a doctrine collection

I'm displaying an html table for a filtered collection of entities and I want to display a checkbox in each row as part of a form which will add the selected entities to a session var. I'm thinking that each checkbox should have the entity id as its…
jah
  • 2,056
  • 1
  • 18
  • 35
11
votes
3 answers

Access static variable in symfony 2.2 twig

I have a class containing constant options in array form: namespace MyNameSpace; class OptionConstants { /** * Gender options */ public static $GENDER = array( 'Male', 'Female' ); /** * University year levels */ …
Floricel
  • 791
  • 2
  • 9
  • 20
10
votes
1 answer

php composer.phar update failed - A typo in the package name

I have created a new Symfony 2.1 project and added a custom package downloaded by a SVN repo. Now I'm tryng to upgrade the project to Symfony 2.2, but anytime I try to execute the command php ~/bin/composer.phar update the following error message…
freedev
  • 25,946
  • 8
  • 108
  • 125
9
votes
3 answers

Gedmo\Loggable logs data that doesn't have changed

I'm using Symfony2.2 with StofDoctrineExtensionsBundle (and so Gedmo DoctrineExtensions). I've a simple entity /** * @ORM\Entity * @Gedmo\Loggable * @ORM\Table(name="person") */ class Person { /** * @ORM\Id *…
8
votes
1 answer

Symfony 2.2 extend ExceptionController

This question is related to the following change (part of Symfony 2.2 release): Part 1 In pre-2.2 Symfony, I was overriding ExceptionController to display some custom error pages. I did that via: parameters: …
isyndicate
  • 177
  • 1
  • 2
  • 7
8
votes
1 answer

Where to place business logic is Symfony 2 model layer?

I'm moving my old codebase to the Symfony 2.2 framework. In my old code, my Article entity has had a method getUrl(), which was returning a URL for current article. In Symfony i have to use Router service to generate such an URLs. I can't access…
Slava Fomin II
  • 26,865
  • 29
  • 124
  • 202
7
votes
2 answers

Why is Symfony 2 responding EXTREMELY slowly in my environment?

I have a VMware virtual machine running Debian Squeeze. All my projects are in a folder on my Windows machine, accessible to the Debian VM via a VMware shared folder. This means that I can work on my projects using a proper text editor on my Windows…
Hubro
  • 56,214
  • 69
  • 228
  • 381
1
2 3
12 13