Questions tagged [symfony-2.4]

Symfony is an Open Source distributed PHP framework. This framework helps to work better (structuring developments) and faster (reusing generic modules).

Symfony is an Open Source distributed framework. This framework helps to work better (structuring developments) and faster (reusing generic modules). Also, this facilitates long-term maintenance and scalability by complying with standard development rules. Compliance with development standards also simplifies integrating and interfacing the application with the rest of the information system.

Symfony version 2.4 is released on December 03, 2013.

Symfony only requires two writing folders, which can be fully configured to adapt to the company's established security policy. Symfony also facilitates the build-up of applications to be hosted, for example by storing sessions in databases or implementing HTTP standard to natively handle website accelerators like Varnish. Symfony simplifies the system administrator's job.

You should be using this tag if your question is related to the use of Symfony framework version 2.4.

166 questions
19
votes
1 answer

Access variable from FormType in types twig template

I created a custom form type like this: class PositioningFlashType extends AbstractType { public function…
Johannes Klauß
  • 10,676
  • 16
  • 68
  • 122
17
votes
5 answers

Symfony2.4 form 'This form should not contain extra fields' error

I'm trying to build app based on REST api ang AngularJS. I've been following this tutorial http://npmasters.com/2012/11/25/Symfony2-Rest-FOSRestBundle.html but have to change some details ( depreciated methods ) and right now when I post to create…
mmmm
  • 3,768
  • 9
  • 36
  • 63
17
votes
2 answers

Failed to start the session: already started by PHP ($_SESSION is set). 500 Internal Server Error - RuntimeException

I am trying to implement a simple login page for my usermanagementbundle and I'm new in creating a form thru formbuilder. There is only 3 function inside my bundle where there is a new session and it is called in different routes, even if I remove…
Cedric
  • 1,236
  • 2
  • 18
  • 35
16
votes
2 answers

Symfony2: How to use constraints on custom compound form type?

Here is a question I've been breaking my head over for a while now. Please know that I'm not a Symfony2 expert (yet), so I might have made a rookie mistake somewhere. Field1: Standard Symfony2 text field type Field2: Custom field type compoundfield…
Maurice
  • 4,829
  • 7
  • 41
  • 50
14
votes
7 answers

Symfony2 FOSElasticaBundle update index for all entities related to the entity updated

I'm using FOSElasticaBundle and Doctrine in my project, and my code works for the selective index update using the Doctrine lifecycle events. The issue I come up against is if I an update a related entity separately. For example a person may be…
Ben Stinton
  • 411
  • 2
  • 8
  • 17
13
votes
2 answers

Twig: set a variable inside a loop, use it outside that loop

I'm trying to define driverid, using set, as a var in for driver in assigned.driver cycle for use later. See below what I'm doing: {% for key, assigned in pgn %} {{ assigned.imei }} …
ReynierPM
  • 17,594
  • 53
  • 193
  • 363
11
votes
1 answer

How to log an entity that has collections?

I want to log all changes of an entity. I looked into Loggable doctrine extension as provided by the StofDoctrineExtensionsBundle. I got it working for fields that store simple data, e.g. string and integers. But my entity also has ManyToMany…
10
votes
1 answer

Symfony2: How to filter the options of an entity-choice form field by a certain attribute?

1.) The Situation (simplified) I have two entities: a Container-entity, which has exactly 1 Content-entity. The content_id is stored in the Container-entity. 2.) Soft-Delete Content-entities I implemented a function to soft-delete Content-entities,…
Chris
  • 321
  • 1
  • 4
  • 14
10
votes
2 answers

Inherit form or add type to each form

I am searching for an easy way to add a bundle of fields to each form. I have found a way to extend the AbstractType and use the buildForm method to add more fields. When creating the form I give the name of my new type (How to Create a Custom Form…
CSchulz
  • 10,882
  • 11
  • 60
  • 114
10
votes
6 answers

Symfony: How to avoid custom form-types getting wrapped in a div automatically?

UserType Form: class UserType { public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add('email', 'email', ['label' => 'EMail']); // various other fields.... } public function…
Rufinus
  • 29,200
  • 6
  • 68
  • 84
8
votes
1 answer

Access mapped entity from form in Twig

I have a entity mapped to a form, but I don't want to have all fields editable, but still want to show the value. For example this is my form type: class GameHasPlayerType extends AbstractType { /** * @param FormBuilderInterface $builder …
Johannes Klauß
  • 10,676
  • 16
  • 68
  • 122
7
votes
3 answers

Symfony: InvalidArgumentException while parsing web.xml

Recently I moved a Symfony-system to another Server and got an error ever since. The technical details are: An apache 2.4 server on a windows server 2012 A fileserver which can be accessed by apache over the local network When I moved the…
Friedrich
  • 2,211
  • 20
  • 42
7
votes
1 answer

Symfony2.5 slow Initialization time compared to Symfony2.4

I just installed both Symfony2.4.4 and Symfony2.5.1 and set up a hello world page + some basic things I use (assetic js/css management etc). Configuration and setup for both projects are exactly the same. I noticed that in app_dev the Symfony2.5.1…
Jones03
  • 1,207
  • 2
  • 12
  • 30
6
votes
1 answer

symfony2 security - disable login path and show forbidden

i am trying to prevent redirect to login page when user is trying to access a page without token, i have single page app and i am only putting the ajax requests under firewall and when a user is doing ajax without token i want the ajax to return…
roy
  • 585
  • 5
  • 14
6
votes
2 answers

Redirect to "/login" if is not logged in

I need to redirect everyone to route /login if: Access to / route (app.php or app_dev.php) Try to access any restricted area and the client belongs to group or have the right credentials but it's not logged in (not so sure this will be necessary…
ReynierPM
  • 17,594
  • 53
  • 193
  • 363
1
2 3
11 12