Tagged Questions
Symfony2 is an open source PHP web development framework for PHP 5.3.9+, focusing on easy and fast development cycles and including state-of-the-art design patterns and programming philosophies. Symfony should not be confused with Symphony CMS.
-1
votes
1answer
11 views
Product category array twig/symfony
So I have this {{ product.category }} which is an array (space, single player, exploration, survival, sci-fi).
I want to display each word from product.category so i can link it to a page. How can I ...
1
vote
0answers
4 views
Extending Sonata User Bundle & custom actions
I have a app with Sonata Admin, Sonata User and Fosuser.
I have extend the Admin file from Sonata Admin to add new column and field :
<?php
namespace AppBundle\Admin;
use Sonata\UserBundle\Admin\...
0
votes
2answers
3k views
Displaying table in twig dynamically
I'm trying to display all the users in my User object without knowing the structure of the object (so I can use the same table to display other collection of objects as well).
This is what it would ...
-1
votes
0answers
10 views
I want to save data into database in netbeans with symfony framework
When I click on submit button I want to save data into database enter code hereUserName
Email
Address
Submit
3
votes
3answers
34 views
Twig: type of dynamic property
Currently, in my index page, I show the value of object properties from dynamic object and dynamic properties.
{% for object in objects %}
<tr>
{% for property in properties %}
...
0
votes
0answers
8 views
Symfony form add field without prefix
I want one hidden field in my symfony form without an prefix. This field stores some information I needed to recreate the form type in my listener. I dont want to iterate over all $request parameters ...
0
votes
2answers
36 views
How do composer knows symfony environment
i try to deploy an app in "integration" environment but after the "composer update" command, the parameters.yml file generated doesn't contains may integration parameters
Here is what i did :
I ...
0
votes
0answers
8 views
URL with Moodle
Moodle Version : 3.1
PHP Version : 5.6
I'm using Symfony2,
I have installed moodle in my site already online,
Everything works fine except that when accessing moodle :
It does not directly access ...
5
votes
3answers
5k views
+50
Where to encrypt/decrypt my data?
I'm using Symfony 2 with Doctrine 2.
I need to encrypt a field in my entity using an encryption service, and I'm wondering where should I put this logic.
I'm using a Controller > Service > ...
3
votes
2answers
6k views
Symfony2: How to add form constraint for a field in bind PRE_SET_DATA depending on the data
I have a form in Symfony 2 with basically two fields:
public function buildForm(FormBuilderInterface $builder, array $options) {
$builder->add('contactType', 'select', array( 'choices' => ...
0
votes
1answer
26 views
Symfony circular reference with EventListener that depends on a service that requires EntityManager
For simplicity, I have a service 'TenantContext', that retrieves the current tenant from the database on each request and therefore requires the EntityManager.
Furthermore I want to associate all ...
0
votes
2answers
37 views
MailGun parameters are invalid for no apparent reason
I have a very simple code that uses MailGun in my Symfony2 application:
public function sendNewEmail()
{
$message = \Swift_Message::newInstance()
->setSubject('Any random ...
0
votes
1answer
22 views
How to access fields of documents referenced by each other in MongoDB ODM?
Let's suppose I have two documents
Users and Purchases. All the purchase have a reference to a User, and Users have a field gender in it.
I want to select the products bought by male clients. So I ...
-1
votes
1answer
21 views
php symfony user_call_func on object (non static)
i'm trying to call a getter of an object dynamically (the getter is in a string) but it won't work:
$getterName = "get" . $name; //creation of the getter name like getFirstname
$value = ...
2
votes
2answers
474 views
How to setup HWIOAuthBundle with FOSOAuthServerBundle
Trying to use both bundles with latest Symfony (V:2.7.2).
FOSOauth is set and works fine, but adding HWIOAuthBundle isn't so trivial. Following the instruction in native Read.me brought me to this:
...
3
votes
0answers
59 views
Symfony2, not able to login, maybe the reason is translation?
I am not able to figure out, why i am not able to login.
I am getting error "The controller must return a response (null given). Did you forget to add a return statement somewhere in your controller?...
1
vote
1answer
9k views
FOSUserBundle overriding register form
I would like to override the register form from FOSUserBundle.
I have followed this page: https://github.com/FriendsOfSymfony/FOSUserBundle/blob/1.3.x/Resources/doc/overriding_forms.md
I want that ...
1
vote
0answers
12 views
Symfony and SwiftMailer sending with starttls
Can someone explain to me how work SSL AND STARTTLS with PHP ?
Il have a dedicated server with Postfix and Dovecot (managed by plesk). I don't have SSL.
To get and send my emails, I use SMTP/IMAP ...
-1
votes
1answer
36 views
symfony 2.8 preprod deployement error 500 on nginx
I tried to deployed my symfony 2.8 app on an nginx prepod server.
Project is working fine on local nginx server and on an other nginx test server.
I followed :
git clone the project
composer install ...
0
votes
1answer
10 views
Hautleook/AliceBundle fixture yml configuration with randomElement faker function
I am trying to configure the yml file for Hauleook/AliceBundle fixture.
Project\MainBundle\Entity\Manager:
manager_{1..30}:
name: '<firstName()> <lastName()>'
profile_image:...
0
votes
0answers
9 views
how can i run callback in sonata_type_model_autocomplete depend on check box in symfony 3
As in attached file, I have a form which has a sonata_type_model_autocomplete listing uploaded images of current user by a callback query.
I have a checkbox under image field to disable this query in ...
11
votes
4answers
12k views
Multiple pattern in single symfony routing
How to make multiple pattern in single Symfony routing?
Normally we have a routing as
blog:
pattern: /
defaults: { _controller: AcmeBlogBundle:Blog:index, page: 1 }
Is it possible to ...
0
votes
1answer
47 views
How to allow only letters in a symfony2 form in twig?
I want to know how to configure a textbox in twig to allow only letters, like a field type to write only names for example. I have something like this on my view:
<div class="control-group">
...
0
votes
0answers
11 views
Laravel 5.3 FileTypeFilterIterator error
Today my laravel 5.3 App showing this error
Fatal error: Class Symfony\Component\Finder\Iterator\FileTypeFilterIterator
contains 1 abstract method and must therefore be declared abstract
or ...
1
vote
1answer
17 views
The Symfone “doctrine:fixtures:load” command missing
I have Symfony 3.1 project with Doctrine and
doctrine/doctrine-fixtures-bundle and
doctrine/data-fixtures installed.
However, when i run a console command
php bin/console doctrine:fixtures:load
i ...
1
vote
1answer
1k views
SonataDoctrineORM - Model extends
I'm using Sonata with SonataAdmin & SonataOrm as told in several tutorials.
I simply would like to remove some default method of DoctrineOrmBundle- ModelManager.php
I tried to override the ...
0
votes
1answer
14 views
SonataAdminBundle configureShowFields with nested entities
For a project which uses symfony2 and the SonataAdminBundle, I am trying to figure out how to embed complete related entities in the show action.
To get more into detail, let's say I have a Article ...
2
votes
2answers
184 views
new (Json)Response shows blank page (Symfony HttpFoundation)
I am using the HttpFoundation in my small project: use \Symfony\Component\HttpFoundation\JsonResponse as JsonResponse;
Unfortunately all my responses (tried JsonResponse, Response and ...
2
votes
2answers
51 views
Map the router placeholder with the URI values
I don't how to explain this so please be easy on me.
The router holds the uri variable key
$router = 'movie/english/{slug}/edit/(id}/{title}';
The URI in the browser address bar
$uri = 'movie/...
2
votes
2answers
69 views
Search for products with their corresponding categories symfony2?
I have to do a query to find me all my products catalog and then list them in my view in this way :
category:
product
product
product
.......
...
1
vote
1answer
73 views
Symfony Doctrine JoinTable
How to JoinTable in DB if I have relation OneToOne->ManyToOne?
I have Data Base MySQL and in table users I need see row client_id. But now I have row user_id in table clients, thats all. But need ...
4
votes
1answer
74 views
symfony2 execute CREATE table query into controller
In my symfony2 application there is a need to create a table on the basis of
user selection. if user selects yes then a new table will be create into database.
I am trying to create table query ...
2
votes
3answers
84 views
Doctrine delete the oldest entry
I have one MongoDb document with 3 fields message, author, sendAt, i have created a query builder to count all DB entries on this document and if there is more than 20 entries, I'm trying to delete ...
1
vote
1answer
16 views
Doctrine wants to “ALTER TABLE coo_users CHANGE id id VARCHAR(255) NOT NULL;” but wants to do this each time I update the schema
If I do bin/console doctrine:schema:update --force the result is:
Updating database schema...
Database schema updated successfully! "1" query was executed
And this is done each time I run the ...
2
votes
0answers
67 views
How to use query function LIKE and CONCAT in the same time
User will send a message for example
user1 = "Show football score today plz"
user2 = "Show basketball score yesterday lol"
the key is "score"
I want to query that word form all sentence by use ...
39
votes
2answers
10k views
Creating a new user with FOSUserBundle fails
I am trying to create a new user from the command line and get this error:
Warning: array_search() expects parameter 2 to be array, null given
in /vendor/friendsofsymfony/user-bundle/FOS/UserBundle/...
7
votes
3answers
15k views
How to use dump in TWIG?
I add for template (index.html.twig) simply:
{{ dump(product) }}
and i have error:
The function "dump" does not exist in AcmeStoreBundle:Default:index.html.twig at line 2
Why this function is ...
1
vote
1answer
30 views
Symfony, how to set the member as active or not
i'm useing symfony in my project and i used this code in twig to show active or disactive button on my members list
{% for item in members %}
<form action="{{dol_url()}}/m71Verein/app.php/member/...
1
vote
1answer
25 views
Lost session with Symfony 2.8 on ovh mutualized server
I use Symfony 2.8 with FOSUserBundle 2. I have upgraded my offer on ovh and some elements of my php configuration changed. I have a big problem because my users can't connect to the website (it ...
0
votes
0answers
43 views
Symfony2 - OVH- erros 500
I'm desperate.
I try to put my Symfony project on my OVH hosts.
I have modified the .htaccess, but I have this error:
Internal Server Error
The server encountered an internal error or ...
1
vote
1answer
13 views
phpunit must be traversable or implement interface Iterator
I'm trying to unit test my service, containing a dependency Finder Component of symfony2(http://symfony.com/doc/current/components/finder.html).
I'm getting :
[Exception] Objects returned by ...
0
votes
1answer
14 views
How to retrieve subject in Sonata configureListFields?
I use Sonata Admin Bundle in my Symfony project and created an ArticleAdmin class for my Article entity.
In the list page, I added some custom actions to quickly publish, unpublish, delete & ...
0
votes
1answer
22 views
Validating one entity's property with another entity's property
Hi I'm new to symfony and doctrine, I'm using php in netbeans and i need to create a validation on an entity. The validation requires that the entity must compare the start and enddate with that in ...
0
votes
1answer
41 views
Replace Constants with actual values Symfony
Hi I have a template store in db: as following:
<p>Dear [[OWNER_NAME]],</p>
<p><br />
We are thanks put [[LOCATION_NAME]] to you.</p>
<p>It is very ...
1
vote
1answer
27 views
Symfony: Form Builder doesn't get OneToMany inputs
So I have OneToMany relation between two entities and I have created the related form to it, but it seems that the FormBuilder, after sending data, doesn't see the children of the entity.
Parent class:...
1
vote
0answers
15 views
FOSElasticaBundle / Wrong entity
I'm new in elasticasearch.
I have 2 websites and when I populate, one of the websites is calling another one's entity.
Here is the configs:
First website:
fos_elastica:
clients:
default:...
1
vote
1answer
20 views
symfony doctrine arrayCollection return 1 item
Hi i have problem with get participants i get only 1 participants but must be more.
Group Entity:
/**
* One Group has Many participants.
* @ORM\OneToMany(targetEntity="UserActivity", mappedBy="...
10
votes
4answers
12k views
Symfony2 : Auto htmlentities using Twig
I'm displaying some variable retrieved in my database using Twig :
<p>{{ my_variable }}</p>
The thing is this variable may contain html tags, such as "<br />".
Twig seems to ...
0
votes
0answers
26 views
Doctrine dynamic mapping
I try to improve the flexibility of our own CMS System. The functionality of this CMS system can be extended by Plugins. There are several instances of this "Core" CMS system. At the moment it isn't ...
2
votes
2answers
51 views
Symfony controller not working
I am very new to symfony and started learning by following their instructions on the website. I created the lucky number controller, but it is not working as I had hoped.
Here is the code for the ...