Questions tagged [symfony-2.7]

This is the Symfony 2.7.x specific tag. Use it in addition to the symfony2 tag if your question is specific to Symfony 2.7.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.7 version of Symfony, that is the second LTS version of Symfony. See the tag for general Symfony 2.x questions.

At 30th May 2015 2.7.0 was released.

Living on the edge

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

267 questions
33
votes
5 answers

Disable deprecated warning in Symfony 2(.7)

Since my Symfony 2 update to 2.7. I get a lot of deprecated erors in PHPUnit and console (message is clear by now). ProjectX\ApiBundle\Tests\Controller\SectionsControllerTest::testPostDebug() The twig.form.resources configuration key is deprecated…
Roel Veldhuizen
  • 4,613
  • 8
  • 44
  • 78
27
votes
2 answers

Symfony 2.7 / 3 - Doctrine: You have requested a non-existent service "fos_user.doctrine_registry"

Doing a composer update today suddenly getting the following error: [Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException] You have requested a non-existent service "fos_user.doctrine_registry". when composer is executing…
ken
  • 399
  • 1
  • 3
  • 6
22
votes
11 answers

Symfony2: No route found for "GET /lucky/number"

I start the tutorial (as newbie) and everythings works fine till: http://symfony.com/doc/current/book/page_creation.html#creating-a-page-route-and-controller at step Creating a Page: Route and Controller I have created a file called…
Atreides78
  • 577
  • 1
  • 7
  • 22
17
votes
2 answers

How to disable the Symfony translation for specific bundles

I am creating a webapp running with Symfony 2.7, which is designed to be used only with one language (a unique locale). I can see in profiler many missing messages in every translation domain, but I don’t need translation at all. How can I disable…
15
votes
2 answers

Different table name and entity name in Symfony2

I have an existing database. Lets say that I have a table named "transactions" and I want to create the corresponding Entity named "Transaction". How can I do that?
Cristhian Boujon
  • 4,060
  • 13
  • 51
  • 90
15
votes
2 answers

Compile Error: Cannot use isset() on the result of an expression

I'm getting this error in a app I am migrating from SF2.0.x to SF2.7: [1] Symfony\Component\Debug\Exception\FatalErrorException: Compile Error: Cannot use isset() on the result of an expression (you can use "null !== expression" instead) at n/a …
ReynierPM
  • 17,594
  • 53
  • 193
  • 363
10
votes
2 answers

symfony2.7 pass translator in service container

In symfony 2.3 it was this line in service.yml to get to the translator In service.yml arguments: [@translator,.... in serviceFunctions.php public function __construct(Translator $translator,...) { $this->translator = $translator; Now I get…
craphunter
  • 961
  • 2
  • 13
  • 34
10
votes
1 answer

'templating.helper.router' service is not found in symfony 2.7

i upgarde my project from 2.6 to 2.7, i get this error in end of work: [Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException] The service "knp_paginator.helper.processor" has a…
ghanbari
  • 1,630
  • 1
  • 16
  • 31
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
7
votes
3 answers

How specify parameter's format in Nelmio ApiDocBundle

I use input property of @ApiDoc annotation for specifieng of parameters of my api that are form's fields. * @ApiDoc( * section="User", * resource=true, * input={ * "class"="Nik\UserBundle\Form\UserType", * }, * …
ghanbari
  • 1,630
  • 1
  • 16
  • 31
7
votes
3 answers

Every parent controller must have `get{SINGULAR}Action($id)` method when i have multi level sub resource in FOS Rest Bundle

I have three controller named BlogController, PostController, CommentController that CommentController is sub resource of PostController and PostController sub resource of BlogController. /** * @Rest\RouteResource("blog", pluralize=false) */ class…
ghanbari
  • 1,630
  • 1
  • 16
  • 31
7
votes
3 answers

Set up registration FOSUserBundle with FOSRestBundle REST API

Problem fixed, check my answer. I'm building a registration endpoint on my Symfony2.7 rest api. I am using FosRestBundle and FosUserBundle Here is the user model :
6
votes
4 answers

Incredibly slow cache:clear of symfony in dev environment

I am facing problem from last few months that in my local environment the command cache:clear is incredibly slow. Many times it takes more than a minute. I tried it with both XAMPP and WAMP but It didn't help. I tried to solve by removing different…
W.Ahmed
  • 61
  • 1
  • 3
6
votes
2 answers

Unable to generate a URL for the named route admin_sonata_classification_category_create

I'm done of installing calassification bundle wiht this error : An exception has been thrown during the rendering of a template ("Unable to generate a URL for the named route "admin_sonata_classification_category_create" as such route does not…
Nacer Naciri
  • 67
  • 2
  • 8
6
votes
2 answers

How can I avoid applying attr to all options of my choice field?

Before Symfony 2.7, the attr value for a choice field applied only to the field itself, i.e. the