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
4 views

SYmfony 2 multiple bundles, one template

I will have this structure: -TaskBundle -FrontendConroler -BackendController -Userbundle -FrontendConroler -BackendController -HoursUserBundle -FrontendConroler ...
0
votes
2answers
18 views

Replicate pass encryption from PHP to JS

I would like to replicate the following PHP code in JS: $salted = $raw_pass."{".$salt."}"; $iterations = "5000"; $digest = hash('sha512', $salted, true); // "stretch" hash for ...
0
votes
0answers
3 views

Symfony2, protect URL

is it possible to protect URLs from getting called from the "url" line in the browser? F.e: i have buttons that start some ajax code, the url to this ajax call is however viewable by looking at the ...
0
votes
0answers
4 views

what is wrong for embedded form?

there are two entity (person n:1 phone) and i want to embed phoneEntity in personEntity. i did any thing based on symfony2 embedded form tutorial but i caught this error: A new entity was found ...
0
votes
0answers
5 views

How to nicely display Doctrine2 Exceptions?

I have a query that output some very inconvenient error message: Fatal error: Uncaught exception 'Doctrine\ORM\Query\QueryException' with message 'SELECT p, e, c FROM Entity\Event e LEFT JOIN ...
1
vote
0answers
6 views

Pagerfanta and Doctrine2 COUNT optimization

I'm using Pagerfanta and Doctrine Adapters with Symfony2 and Silex. As my database became bigger I noticed huge load on admin stats pages that display big data with pagination. I checked profiler and ...
0
votes
0answers
6 views

Symfony Profiler on Console Command

When running a Symfony app in the dev environment, the web debug toolbar allows me to see how many queries that Doctrine generated. Is there a similar profiler option for Console commands?
1
vote
1answer
17 views

Symfony sharing controller object

I've started a project on Symfony not from scratch. I would like to have your feedback on a way of coding i found in this application. The application as a lot of business classes. Some of those ...
2
votes
1answer
11 views

Symfony best practice for data export file location

I am writing a console command which generates data files to be used by external services (for example, a Google feed, inventory feed, etc). Should the location of the generated data files be within ...
2
votes
1answer
18 views

How can I dynamically set a parameter in Symfony2?

I'm trying to dynamically set a parameter in Symfony2 (that I cannot statically set in my parameters.yml file). My approach is to use an EventListener: namespace Acme\AcmeBundle\EventListener; use ...
1
vote
3answers
19 views

Symfony2 inject EntityMananager in FormType

Custom form type use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormInterface; use Symfony\Component\Form\FormView; use ...
1
vote
3answers
42 views

Difference between parameters.yml and config.yml in Symfony2

I don't understand the difference between these two ways of setting global constants in Symfony2. Is it only about being able to set default values and types in config.yml (+configuration.php) ?
1
vote
2answers
30 views

delete several rows where attribute = x

I need to delete all rows where the image_id = x applies like this DELETE FROM `ImageVoters` WHERE image_id =1 How do I do this using DQL? Since im trying to delete several rows at once the ...
0
votes
1answer
21 views

SonatajQueryBundle no longer installed as dependency

Fatal error: Class 'Sonata\jQueryBundle\SonatajQueryBundle' not found in /Users/.../app/AppKernel.php on line 21 I'm getting the above error after upgrading the SonataAdminBundle versions to ...
0
votes
1answer
23 views

Symfony2 fetch data from table with OneToOne relationships

I got problem when I want to fetch data from the table that have OneToOne relationships. Here I have table tbl_userand I make a relationship to a table named tbl_admin. User.php <?php namespace ...
0
votes
1answer
12 views

Symfony2.3 login in Internet Explorer or Safary

My doubt is about symphony. I make this web http://trivialarbitros.tk/ and when try to acces with email (abc) and password (abc) have success in chrome or firefox but don ‘t work with IE or Safary. ...
0
votes
0answers
5 views

Generate code and insert in external site from KML/KMZ sources using Symfony 2.1

I'm working in a Symfony 2.1 project and I'm using Google Maps API V3 for generate KML/KMZ files based on what user do for example: add markers and some other. The file is generated under ...
1
vote
1answer
27 views

query builder getResult() performance

I'm using latest Symfony2, creating small app. I have this query: $qb = $repository->createQueryBuilder('first') ->select('first') ->join('first.second', 'second') ...
0
votes
0answers
21 views

Symfony2 cache:clear outputs the content of services.yml file

In Symfony2, everytime I clear my cache via the console: php app/console cache:clear The console prints out the contents of my services.yml file! If I manually delete the cache via rm -rf ...
0
votes
0answers
11 views

Doctrine2 bug imports 'private' variables from MappedSuperClass when generating entities

I'm using Symfony's entity classes in conjunction with Doctrine's ORM annotation to persist the values to the database. Most tables need a few standard fields, so I have created a base entity that all ...
0
votes
0answers
21 views

Symfony/Form validation error with File input type

We're having a strange issue with Symfony/Form and the File type, as well as the File constraint. So, as a perquisite I feel I should mention I am using the Symfony/Form component outside of Symfony ...
0
votes
1answer
17 views

getting the gettext behavior using the Po File Loader in the translation provider in Silex

I'm using the translation provider and the PoFileLoader in Silex and everything works super great. $app['translator'] = $app->share($app->extend('translator', function($translator, $app) { ...
0
votes
0answers
26 views

Custom product entity attributes in symfony2

I need to implement custom product attributes with webshop like symfony2 application. How to do this in the symfony2 manner? I heard about EAV model approach, but this is to hard to search and filter. ...
1
vote
2answers
25 views

How to turn this SQL query into Doctrine Query

I'm using this native SQL query on symfony (Which is a really bad practice) but I'm struggling to get it running with DQL without triggering several errors. SELECT Image.path, Image.name FROM Image ...
1
vote
1answer
22 views

Why is Symfony2 ignoring my APPLICATION_ENV?

In my Apache virtual host, I've set my environment variable to dev: <VirtualHost *:80> ServerName localhost SetEnv APPLICATION_ENV dev DocumentRoot /Users/jonathan/localhost/web ...
0
votes
1answer
25 views

Use LESS class from another file [Symfony2]

I'm working on Symfony2 and i use Less for my stylesheets. I've an error when i'm trying to use a class from another file : In my main.less file : .noBorderNoOutline { border : none !important; ...
1
vote
0answers
28 views

How to create complex query symfony2 doctrine

Hello I want to create a complex query where I need request info from 5 tables and group it by companies.name applying a filter by branches.idMunicipality my query is the next: $em = ...
0
votes
1answer
14 views

Filter by entity collection. Symfony2

I have this entities class Business { ... /** * * @ORM\ManyToMany(targetEntity="Category", inversedBy="businesses") * */ private $categories; ... } class Category { ... /** ...
0
votes
2answers
13 views

WSSE Authentification using FOSUserBundle

I have a problem when I want to authenticate a user with WSSE from my REST API created with Symfony. I followed the guide on the site symfony wsse authentication ...
0
votes
0answers
7 views

Can PDO::MYSQL_ATTR_LOCAL_INFILE be set using config files in Symfony2

Is it possible to set the PDO / Doctrine config in Symfony2 to use PDO::MYSQL_ATTR_LOCAL_INFILE => true without using PDO directly? My use case is loading a csv file into MySQL on Amazon RDS. ...
0
votes
1answer
20 views

Check if date is in range -45min +45min using Doctrine DQL with Symfony2

I want to query my database using DQL and find out if there is any record in this table of mine wich collides with one that I'm about to insert, the thing is that I cannot insert records if the time ...
0
votes
0answers
15 views

Deploying Symfony2 with Capistrano3 - permissions

I'm trying to deploy a Symfony2 based site with capistrano/symfony, and I've already gotten it to properly run the 'composer install'. However, it runs that as the deployment user. When the website ...
1
vote
1answer
18 views

Retrieve records from database where a field equals multiple values in Symfony2

I'm trying to do a count on a table in a Symfony2 project where the records need to match a several values in one field. The SQL is something like this: SELECT * FROM posts WHERE userid IN ('3,4,1') ...
1
vote
2answers
32 views

Search and replace in YML file + PHP

Is it possible to search for a string in a yml file and replace it? This is a part of my yml file: 'PST Today': 'PST Today' 'PST Today Table': 'PST Today Table' Hosttess: Hosttess 'Permit Total': ...
0
votes
1answer
21 views

Symfony2 Doctrine DB: Many-To-Many or 2 One-To-Many

Please forgive me as I am a beginner to doctrine. I am writing an application to parse some sports data. I have a simple OneToMany Team in relationship to Players. class Team { /** * ...
0
votes
1answer
25 views

Symfony 2 - can't configure application for hosts [solved]

I have problem with setting hosts for my symfony application. For now we have one domain, let's sey it was domain.pl for all four languages. So rule in YML was: front_common: resource: ...
0
votes
2answers
21 views

Symfony2 impossible to clear cache on my prod server

i've deployed my S2 Project on my remote server (nginx) and when i try to clear the cache i've got an error: [RuntimeException] Unable to write in the ...
0
votes
1answer
39 views

Multiple forms on same page

I use FOSUserBundle with Symfony2. By default FOSUserBundle profile edit and password change is on different pages, but I need these forms on one page and add one custom form. My idea is to override ...
0
votes
1answer
22 views

Symfony2 - getRepository of entity on Entity subfolder

Most of the time, entities are located at src/Project/FooBundle/Entity/Foo.php. Then you can access the repository by: $this->getRepository('ProjectFooBundle:Foo'); But how to access the ...
0
votes
1answer
16 views

Twig: Set default translation language

there is situation like this: example.twig.html <P>{%trans%}Example Message 1{%endtrans%}</P> <P>{%trans%}Example Message 2{%endtrans%}</P> <P>{%trans%}Example Message ...
0
votes
1answer
10 views

Capifony rollback doesnt works

My Capifony setup works... I can deploy multiple versions... C:\xampp\htdocs\example>cap deploy --> Updating code base with remote_cache strategy --> Creating cache ...
1
vote
1answer
17 views

How can I access the container in a before kernel listener in Symfony2?

I try to implement a before kernel listener (see reference) where I simply set some parameter values (that I have to fetch dynamically and cannot statically declare in my parameters.yml file). This ...
0
votes
1answer
18 views

Doctrine, QueryBuilder : use particular “where” with parenthesis

I got a problem to make a "simple" query with the Doctrine QueryBuilder. I try to get some "persons" which are on 10 km max. My query : $QB = $this->createQueryBuilder('p'); ...
0
votes
1answer
21 views

Symfony form: how to process a field after valid submission?

I have made a Symfony 2 form to edit a EmailAccount entity class EmailAccount { protected $host; protected $user; protected $password; } However the $password field is encrypted with ...
0
votes
0answers
22 views

All forms in Symfony 2 app erase their data before validating

I have a small app running on Symfony 2.4, which works perfectly fine on my local setup. But I deployed it on a shared-web hosting service (OVH), and lately, all the forms stopped working. Yes, even ...
0
votes
0answers
22 views

Remove https://waybackassets.bk21.net/app.php from my Symfony in a subfolder url

I created a Symfony project in a subfolder named api. This new API will be host on a server where i can't modify the Vhost config. I deploy my site, but the url to access to the routes looks pretty ...
0
votes
1answer
35 views

Entity Repository Method not found

I've some trouble with an method Repository. I want to find all user from city (address) from province form the state. I thought it's was good to divide all request method in Repository for more ...
0
votes
0answers
16 views

Your hydrator directory must be writable Symfony

Hi My project in Symfony2.4.2 and MongoDB.Every thing is working fine in my localhost. But when i migrate code on my staging server I am facing following error. Even i have done all kind of solution ...
0
votes
0answers
19 views

symfony2 get firewall name on login page

I'd want to use a login page to access different firewalls, so I need to get information about the firewall I'm logging in. In my controller I'd use ...
1
vote
0answers
13 views

SonataAdmin on Symfony2 - edit inline choice

I'm having trouble with the Sonata Admin Bundle, which runs on Symfony2. I have an entity with an enum field, which I converted to string, because there are no enums available. I used choice as a ...