Questions tagged [symfony-2.1]

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

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

As of May 2013, 2.1 is deprecated in favor of the newer versions.

Information

This tag is specific for the 2.1 version of Symfony, which has been released on the 6 September 2012. See the tag for general Symfony 2.x questions.

Symfony 2.1 code is hosted and versioned on github.

As of 2 June 2013, the latest stable release of Symfony 2.1 is version 2.1.11.

Useful links

1094 questions
0
votes
2 answers

How can I go about updating a ChoiceType's values in a FormEvent in Symfony 2.1?

I'm thinking I may need to extend LazyChoiceList and implement a new FormType, so far I have: /** * A choice list for sorting choices. */ class SortChoiceList extends LazyChoiceList { private $choices = array(); public function…
Steve
  • 5,771
  • 4
  • 34
  • 49
0
votes
1 answer

symfony2.1 translatable saved, but not retrieved

Basically, I had the same problem as here: Symfony2 & Translatable : entity's locale is empty Translations where saved in the ext_translations table, but where not being displayed. After adding the proposed fix, it DID work. Today I upgraded from…
Sam Janssens
  • 1,491
  • 1
  • 12
  • 30
0
votes
1 answer

Is there any way that i can make few tables write proof in doctrine2 mysql

I am building a Symfony 2.1 Doctrine 2.3 app. As I was not able to fully code the complex form, there is possibility that my few tables gets updated which I don't want. Is there any way that I can lock those tables so that whatever happens data…
Mirage
  • 30,868
  • 62
  • 166
  • 261
0
votes
1 answer

Missing 'format_date' Twig filter in SonataNewsBundle

I've just installed SonataNewsBundle. I encounter this exception while trying to go _http://localhost/news: The filter "format_date" does not exist. Did you mean "format_file" in SonataNewsBundle:Post:archive.html.twig at line 20 The question is…
Enlightened
  • 239
  • 2
  • 13
0
votes
2 answers

Symfony2.1 Embedded Forms and Foreign Key Relations

I decided to completely rephrase my question. Hopefully my issue is much clearer this way. How do you embed forms that represent a foreign key field within an entity? For example, a Property has a foreign key to a table of Statuses (Owned,…
mhoff
  • 31
  • 1
  • 10
0
votes
1 answer

Call EntityManager inside a form

We can easily custom the powerful Symfony2 form component with an entity Field Type use Doctrine\ORM\EntityRepository; // ... $builder->add('users', 'entity', array( 'class' => 'AcmeHelloBundle:User', 'query_builder' =>…
Tom
  • 69
  • 1
  • 6
0
votes
1 answer

Symfony2, HWIOAuthBundle and FOSUserBundle - how to create users

My goal is to use these bundles to connect to MailChimp OAuth or Facebook (not necessarily as a login option but that could come later - right now just want my app authorized to access the MailChimp API) - I've got the whole process somewhat working…
cyberwombat
  • 38,105
  • 35
  • 175
  • 251
0
votes
2 answers

calculation of the area of a rectangle

I struggle organising my code, and I would like to share my "problem" with you by using a simple example: the calculation of the area of a rectangle. I put the code for example, but reading the first intro on each class section explains the…
Mick
  • 30,759
  • 16
  • 111
  • 130
0
votes
1 answer

Symfony form collection read-only for first entry

How can I set the read-only option only for the first item in the collection when rendering a form? My simple models: class Main { public $others; } class Other { public $field1; public $field2; } Simple Form Type for my models: class…
VlastV
  • 86
  • 9
0
votes
1 answer

How should I go about embedding a collection of new entities in a Symfony2 Form?

I need to write a form for creating a new entity and with it, up to 3 relations (which are new entities). I can either have it dynamically attach/delete them dynamically (which could be useful) or have all 3 always be related to the entity, and for…
Steve
  • 5,771
  • 4
  • 34
  • 49
0
votes
1 answer

Using composer to install third party symfony bundle

Ok. Composer seems great. But is more complex that deps method to add new bundles. I still don´t get it. Please someone give me a complete example on how to add a third party bundle to a symfony2 2.1.0-BETA4 installation. The bundle I want to add is…
Mauricio Lopez
  • 447
  • 4
  • 12
0
votes
2 answers

Symfony2 Undefined Index Parent when rendering a Form

Symfony 2.1 Beta 4 When I am rendering my form in my twig template, if I try to use form_widget or form_rest, I will receive this error - "An exception has been thrown during the rendering of a template ("Notice: Undefined index: parent in…
mhoff
  • 31
  • 1
  • 10
0
votes
2 answers

symfony 2.1 set form theme in controller

Recently I used setTheme function in symfony 2.0 from Symfony / Bridge / Twig / Extension / FormExtension.php, eg: $this->get('twig')->getExtension('form')->setTheme($view, $theme); There is no such function in sf2.1. what's the alternative way to…
vilku
  • 28
  • 2
0
votes
1 answer

symfony2: insert ace in class

I have this error when I try add ace in class: Warning: PDO::quote() expects parameter 1 to be string, object given in .../vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php line 568 My code: $oid = new ObjectIdentity('class', new…
n1c01a5
  • 88
  • 9
0
votes
1 answer

How to install EventDispatcher in symfony2

I am not able to get how can i install EventDispatcher in symfony2. I mean in which folder ihave to extract those contents This is the official docs https://github.com/symfony/EventDispatcher
Mirage
  • 30,868
  • 62
  • 166
  • 261