Questions tagged [symfony-2.6]

This is the Symfony 2.6.x specific tag. Use it in addition to the symfony2 tag if your question is specific to Symfony 2.6.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.6 version of Symfony, which was released on the 29th November 2014. See the tag for general Symfony 2.x questions.

Living on the edge

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

Useful links

163 questions
31
votes
2 answers

SF2.6 OptionsResolverInterface deprecated and AbstractType:setDefaultOptions

since "Symfony\Component\OptionsResolver\OptionsResolverInterface" is deprecated in SF2.6 I tried to update my FormTypes:
Ferret
  • 1,440
  • 2
  • 12
  • 17
13
votes
4 answers

FOSRestBundle setup for return JSON but still asking for Twig template

I have configured FOSRestBundle as following: #FOSRestBundle fos_rest: param_fetcher_listener: true body_listener: true format_listener: rules: - { path: ^/, priorities: [ json, html ], fallback_format: ~,…
ReynierPM
  • 17,594
  • 53
  • 193
  • 363
11
votes
1 answer

TokenStorage sometimes returns null in Service

I have a Service that get's the current logged in user, which only works some of the time whilst in the dev environment. The problem seems to be whenever I change the Twig templates and refresh I get the error: Error: Call to a member function…
Wizbyt
  • 111
  • 1
  • 5
11
votes
1 answer

Logs an entire array using Monolog

Is there any way to log an entire array using Monolog? I have been reading several docs but didn't find a way to log the entire array in a readable format, any advice? Docs I've read: Monolog, how to log PHP array into…
ReynierPM
  • 17,594
  • 53
  • 193
  • 363
11
votes
1 answer

How to override others dependencies in composer.json

I'm using AliceFixturesBundles and this depends on NelmioAlice and Faker. Dependencies are handled internal as for example: https://github.com/h4cc/AliceFixturesBundle/blob/master/composer.json { "name": "h4cc/alice-fixtures-bundle", …
ReynierPM
  • 17,594
  • 53
  • 193
  • 363
8
votes
2 answers

How do I check if object was found in a Doctrine2 repository?

I am finding a entity by its PK as follow: $ent = $em->getRepository('AppBundle:Representative')->find($id) What is the right way to check whether $ent is a real Representative object or not? What I mean with real is that $ent currently exists on…
ReynierPM
  • 17,594
  • 53
  • 193
  • 363
8
votes
2 answers

Symfony: LoggingTranslator vs Translator

I want to inject my translations string into a service, so I used this in the service definition: arguments: [@doctrine.orm.entity_manager, @translator] I used this in the constructor: public function __construct(\Doctrine\ORM\EntityManager…
b85411
  • 9,420
  • 15
  • 65
  • 119
7
votes
1 answer

Symfony Form with subform

I have a user form and a contact form in my user form i tried to add my contact form to the user form When I tried to add $builder->add( 'contact', new ContactType() ); It failed with You cannot add children to a…
Alexander Schranz
  • 2,154
  • 2
  • 25
  • 42
6
votes
1 answer

REST API authentication and authorization workflow with cookies on client side

I'm building a REST API app in Symfony2 and I'm trying to find a good way to handle user authentication and authorization. There are many solutions out there, but so far none of them addressed all my requirements/concerns. The API will primarily be…
tomasp
  • 71
  • 3
5
votes
1 answer

JMS serializers error when property does not exist

I am creating a symfony2 project and using the JMS serializer bundle to serialize my object for database storage (I know this is not the best way). But now my problem is, when I change a property of my object and deserialize the Json string the…
Mr.wiseguy
  • 4,092
  • 10
  • 35
  • 67
5
votes
1 answer

Symfony 2.6 error after using composer: "Vendor libraries must be installed"

After creating or updating a Symfony 2.6.1 project with composer, I get a "Vendor libraries must be installed" error and it suggests running php composer.phar install to install them. The exact steps I'm taking:- composer create-project…
monkeyhybrid
  • 356
  • 3
  • 10
4
votes
3 answers

Symfony 2 one entity event listener is running on every entity load

I'm new to Symfony and following the Jobeet tutorial. I have three entities - Job, Category and User. I have the following service listener. src/Ibw/JobeetBundle/Resources/config/services.yml services: ibw.jobeet.entity.job.container_aware: …
Sithu
  • 4,752
  • 9
  • 64
  • 110
4
votes
2 answers

Symfony using salt in encodePassword

I am using Symfony 2.6.6 and I am currently trying to use a salt on my database users. In the registration process I do the following hash while persist the user information via…
user4793675
4
votes
1 answer

Can I include PHP templates in a TWIG base template or vice versa?

I am currently in the process of refactoring and restructuring an existing Symfony 2 application. There are a few base templates and all other templates inherit from them. Right now, all the templates are PHP. I am planning to migrate the…
Chris
  • 6,914
  • 5
  • 54
  • 80
4
votes
1 answer

Symfony 2.6 overrides PHPUnit_Framework_Error

I have a unit tested application which we have updated from symfony 2.3 to 2.6. We followed all upgrading docs and had to change only some minor stuff. Everything is working perfectly, except for the PHPUnit tests. We have 2 seperate runs, one for…
NDM
  • 6,731
  • 3
  • 39
  • 52
1
2 3
10 11