Symfony2 is an open source PHP web development framework for PHP 5.3.3+ focusing on easy and fast development cycles and including state-of-the-art design patterns and programming philosophies.

learn more… | top users | synonyms (1)

0
votes
0answers
5 views

Output array in Twig

I trying to output array from database to screen. In my entity: /** * @ORM\Column(type="array", nullable=true) */ private $category; In my twig template: {% for category in ...
1
vote
1answer
23 views

Hiding variables in URL - the book

I've got a problem with hiding variables in the URL. I read the chapter about routing in the Symfony book and it says: "Beautiful URLs are an absolute must for any serious web application. This means ...
1
vote
1answer
26 views

Symfony2 doctrine complex query

I have two entites User and File. I have a User OneToMany File relation. The field for relation from User is fileCommercial, and from File is commercial. In the entity File i have a field state. I ...
1
vote
0answers
12 views

Mapping xml to xml using PHP and Symfony 2

I'm facing a problem to solve. I'm getting data in a structured XML format (quite complex with a lot of nested nodes) and I need to map it to a different domain. So far I'm parsing input into ...
0
votes
0answers
14 views

Symfony I18n subdomain routing

We have a symfony project with multiple domains/subdomains tied to it: domain.se en.domain.se admin.domain.se en.admin.domain.se We are using a forked version of JMSI18nRoutingBundle to create ...
2
votes
1answer
17 views

simple example for the creation of a custom directory namer

I have read the main idea of how Create a custom directory namer on github. But, I did not manage to know how to start. So, I am wondering if there is simple example for it. Thank you very much.
0
votes
1answer
27 views

Bootstrap sticky footer overlapping content

I'm new to Bootstrap, and I'm trying to use it with Symfony2. I already have a main topbar sticky which is used for navigation. My problem is when I try to add a similar footer which is sticky at the ...
0
votes
0answers
9 views

HWIOAuth, FOSUserBundle and Facebook api 2.1: how to force users to define their own username and email

I've just integrated a Symfony2 application with HWIOauthBundle and FOSUserBundle, following this guide. The guide, works fine with Facebook api 1.0. The guide works with facebook user's username and ...
0
votes
0answers
32 views

Symfony2 sessions in service

I'm getting a problem with Symfony2 sessions. I'm trying to make a service which is executed at the top of every controller. The aim of this service is to authenticate user. I first check the ...
1
vote
0answers
10 views

JMS Serializer: Dynamically change the name of a virtual property at run time

I use JMS Serializer Bundle and Symfony2. I am using VirtualProperties. currently, I set the name of a property using the SerializedName annotation. /** * @JMS\VirtualProperty() * ...
1
vote
1answer
13 views

SonataAdminBundle disable editing only on certain items

I am currently working on a project where Moderation is the requirement. There are multiple groups of users: Content Creator Content Reviewer Admins The business requirement is that once CREATOR ...
1
vote
0answers
23 views

Field specific errors on repeated field

I am required to display errors under specific fields depending on the situation. In my case there can be two. Which are Password is empty and Passwords do not match. Currently all the messages gets ...
0
votes
1answer
13 views

Doctrine: referenced object always null OneToMany / ManyToOne cascade

Please tell me why the value of field 'pool_id' is always NULL in 'Question' Table? (To add fiels 'Question' in the form used JS) Pool.php use Acme\ExamBundle\Entity\Question; use ...
-1
votes
0answers
10 views

Mongodb symfony2 fulltext text search

In symfony2 i have problem with mongodb fulltext My entity /** * @MongoDB\Document * @MongoDB\Indexes({ * @MongoDB\Index(keys={"nom"="text"},unique=true) * }) */ class Mail { ...
0
votes
1answer
21 views

how to remove a form field in embedded forms from symfony 2 controller

I have a form as below: class AdminEmployerForm extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options) { $builder ...
1
vote
0answers
19 views

Reattach entity with relations to resetted entity manager

I am using the default entity manager and retrieve a list of entities with createQuery()->getResult(). I iterate over them and when executing some stuff there could be an exception. I catch the ...
2
votes
0answers
26 views

Symfony2 - How do I configure Field Validation on a Field Extension?

Goal Custom Formelement written as an Extension of the (Doctrine) Entity Field. The Element is rendered as a Select2 Element with Tagging. This allows to choose multiple items from a list or add a ...
0
votes
0answers
29 views

How to access 'attr' in symfony2 form layout

I got problem with accessing form input parameters created in form builder via: 'attr' => array('foo' => 'bar') in form div layout. I noticed that i can get 'label_attr' in form_label block ...
0
votes
1answer
16 views

Scheduling push notifications with symfony2

I have been recently tasked to implement a push notification system for the mobile apps of a commercial web app using Symfony2. I have used ...
0
votes
2answers
16 views

FOSUser bundle can't create user in command line

I am new to symfony (symfony2) so i was asked to install sonata admin plus FOSUser bundle to be integrated. Everything went fine, the sonata admin is working fine and the configuration for the fosuser ...
0
votes
2answers
12 views

Symfony2 security firewall redirect

In my firewall in the file "security.yml", I want to do a redirect action when the users is not login. But this redirection don't go to a login form. I want redirect the anonimous users to the home ...
0
votes
0answers
27 views

Problems getting an image to upload to db with laravel

So I want to upload and image and my view looks like this: <form action="" class="dropzone" enctype="multipart/form-data" method="post" id="my-awesome- dropzone"> <div ...
0
votes
0answers
11 views

Doctrine: get entities paginated filtered by a releated entity

im developing a blog in symfony using doctrine. Created a Post and a Category entity with ManyToMany relation beetwen them (a post can have several categories). For my main page im using doctrine ...
0
votes
1answer
18 views

Identify a service

I'm using SensioLabsInsights to get reports on my application, and one of the violations does not give me a lot of info to correct it. Here is the screenshot : As you can see, I have to find the ...
0
votes
0answers
8 views

symfony2 the Doctrine of LeftJoin Query error:Call to a member function add() on a non-object

Error: Call to a member function add() on a non-object in E:\xampp\htdocs\symfony\vendor\doctrine\orm\lib\Doctrine\ORM\PersistentCollection.php line 177 Will leftjoin how to write the statement was ...
0
votes
1answer
9 views

cvc-complex-type.2.4.a: Invalid content was found starting with element 'foo'

I am using laravel 4.2. My project runs on a xampp installation and my database is mysql/phpmyadmin. I have installed the ide helper plugin from barryvdh. After installing the plugin I get some weird ...
0
votes
1answer
19 views

Symfony2 how can I get annotation from entity?

I have an entity /** * @Grid\Source(columns="id, districtId") */ class $entity { } How to make the ClassLoadMetadataEvent , to read the annotation
0
votes
0answers
15 views

cant import compass to symfony2 project

I'm trying to implement some small project into symfony2.5, when I have added the the configurations of the compass to my config file and installed all the needed packages (ruby,sass,compass) though ...
0
votes
1answer
14 views

Unable to generate a URL for the named route “sonata_admin_dashboard” as such route does not exist

Complete error message is: [2014-10-12 08:07:45] request.CRITICAL: Uncaught PHP Exception Twig_Error_Runtime: "An exception has been thrown during the rendering of a template ("Unable to generate a ...
0
votes
0answers
11 views

json encode one to many relationship symfony2

I'm having a hard time getting json when my entities have one to many relationship. T I have a Product entity `class Products { /** * @var integer * * @ORM\Column(name="id", type="integer") * ...
0
votes
1answer
26 views

Symfony2 Routing annotation Error

i'm working on symfony2 project, when opening index page I got route error like this : An exception has been thrown during the rendering of a template ("Parameter "id" for route ...
0
votes
1answer
26 views

Doctrine: Multiple orWhere with LIKE condition

Use table with structure: id | count /string/id1 | 3 /string/id1/r1 | 2 /string/id1/r2 | 1 /string/id2/r1 | 2 /string/id2 | 3 /string/id2/r1 | 2 /string/id3/r1 | 5 and ...
0
votes
1answer
13 views

Very simple example of event listener on preUpdate() event of an object hangs/fails

Event Listener example below works fine for prePersist() and postPersist() however browser times out for preUpdate() and postUpdate(). Anyone knows why this is happening? Note: Event listener is the ...
0
votes
1answer
9 views

Firewall failure path ignored on second attempt

With a firewall failure_path set, a user's first failed attempt at login follows the failure path. When the user clicks again on login, a Bad Credentials exception is thrown rather than allowing the ...
0
votes
1answer
27 views

Cannot call a command from a controller in Symfony2

I am trying to run a command from a controller but it does not work. This is my code: $email = $request->get('email'); if (empty($email)) $email = ...
1
vote
2answers
24 views

Disable composer for update?

I made project in Symfony2 and i use composer to get all required bundles. I got there for example: "symfony/symfony": "2.5.*", "knplabs/knp-snappy-bundle": "dev-master", "knplabs/knp-menu-bundle": ...
1
vote
0answers
18 views

Doctrine2 Symfony2 migration on multiple databases

I'm having a bit of trouble doing a db migration on a non-default database with Symfony2 and Doctrine. I have two dbs and two entity managers I'm working with. I have two bundles, each which works ...
0
votes
1answer
22 views

Form post-processing in Symfony2

I am new of Symfony, and I am trying to create a form bound to an Entity User. One field of this entity is of type ArrayCollection. It is actually a OneToMany relationship with objects of another ...
0
votes
1answer
8 views

Symfony on heroku fail to install packages on push

I can't push my project on heroku because it fails on build because of packages. Could anyone help me making this working. I've tried to add this to my composer.json "ext-intl": "*" Thanks for your ...
1
vote
1answer
19 views

Symfony2 Production incorrect “404”

I'm trying to change my environnement from dev to prod. When i'm trying to go on an invalid route with prod env, i get the dev error page " NotFoundHttpException:" , instead of the prod error page ...
2
votes
2answers
19 views

Boostraping symfony 2 for pthread from command

I'm trying to start threads from symfony 2 command. protected function execute(InputInterface $input, OutputInterface $output) { $parser = $this->getContainer()->get('app.article.parser'); ...
0
votes
1answer
14 views

Ending Newline Behavior of YAML::parse() with Scalar content written in block form using a literal style

I have the following YAML file: street: | 123 Tornado Alley Suite 16 price: 1.47 So if I parse that file with YAML::parse() from the symfony2 YAML component I expect ...
-1
votes
0answers
13 views

sonata installation on windows xampp

i want to install sonata on windows 8 xampp. I use comand php composer.phar create-project sonata-project/sandbox:2.3.x-dev and after download I get error. I found that error is for me 2 lines: in ...
-2
votes
0answers
28 views

Adding a new class in Symfony 2 for API calls

I'm setting up experiments on my site using the API client, I've installed the API client package (https://packagist.org/packages/google/apiclient) but now I need to set up a class somewhere to ...
2
votes
2answers
16 views

ContextErrorException when uploading file through VichUploaderBundle

I am trying to upload a file based on the VichUploaderBundle. I got this error when implementing it: ContextErrorException: Catchable Fatal Error: Argument 1 passed to ...
0
votes
0answers
14 views

Symfony2 structural composite pattern with entities

I am trying to implement a simple menu composite pattern. These are the following classes i came up with. MenuItem: namespace MYNAME\MYBUNDLE\Entity; use MYNAME\MYBUNDLE\Menu\MenuComponent; ...
0
votes
0answers
25 views

symfony 2.3 call entitymanager class in subscriber issue is still not resolved

The issue is follow my previous question : Please click on this to know more details I am still not able to access doctrine repository class in subscriber class. I have already followed steps ...
-3
votes
1answer
42 views

What if anything, is Symfony 3

I keep hearing about Symfony 3, in particular the new directory structure, but I can find nothing about a release date. Are there plans to release a new major iteration of symfony?
1
vote
1answer
28 views

Dependancy Injecton or Service Locator - Symphony

i have started to go through Symfony2 code, studied a little bit small classes like Pimple and after few hours of examintaion have come to strange idea. The best start for this is to explain how I ...
2
votes
1answer
31 views

FOSUserBundle One-To-One mapped Entity not saved

Hi Folks i have a question regarding implementing One-To-One in Entity FosUserBundle. User Entity Has One To One Mapping With Profile Entity. I have override the basic RegistrationFormType as per ...