Tagged Questions
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.
0
votes
1answer
4 views
Symfony2: how to add a Doctrine Entity Array to FormBuilder
i'm working with Symfony and Doctrine, i have a function that will select rows based on specific criteria:
$entities = $repository->getSomeEntities();
now i want to render those entities in a ...
0
votes
0answers
3 views
Get entitymanager from within an entity
Yes I know, I'm not supposed to do this. But from a developers point of view, it "seems" the easiest solution in my particular case (but I'm open to better suggestions).
I have 3 entities: List, Item ...
0
votes
0answers
6 views
Call to a member function on a non-object error symfony2
This is an odd one. I have this method, that is the callback for the FormEvents::POST_SET_DATA event in an EventSubscriber of a form in Symfony2:
public function preSetData(FormEvent $event)
{
...
0
votes
1answer
13 views
can I use data transformers to combine fields in forms in symfony2
Is it possible to use Data transformers to merge (n) fields in a form into one persistable field?
If it's possible, how to do it? The cookbook only gives an example to transform one piece of data into ...
0
votes
0answers
6 views
Symfony2 skip resource import if non-existant
When I run my Symfony 2 app in test mode it loads the config_test.yml. This will load the main config.yml and the parameters_test.yml.
imports:
- { resource: config.yml }
- { resource: ...
1
vote
1answer
14 views
Symfony2 twig template in a template like wrapping content
I have a question about templating in Symfony2 and wrapping blocks with html etc.
I am wondering if what I am doing is the right way, or if there is another more simple way to achieve my goals.
I ...
0
votes
1answer
7 views
Symfony2 FOSRestBundle: Demands an Array But Cannot Parse it in config.yml
I'm using the friendsofsymfony/rest-bundle": "1.0.*@dev" bundle, trying to upgrade from Symfony 2.2 to Symfony 2.3. In my app/config/config.yml file, I'm trying to specify rules for the fos_rest ...
0
votes
0answers
11 views
Expection: The merge filter only works with arrays or hashes in “HerzultForumBundle:Topic:new.html.twig”
I'm improving my web application by adding more languages. I've done it following this tutorial: https://coderwall.com/p/eiqd_g
Everything seemed to work fine, but now I've figured out that when ...
-1
votes
0answers
15 views
Symfony2 fires an error “class 'stdClass' was not found…”
The exception:
"The class 'stdClass' was not found in the chain configured namespaces
test\UserBundle\Document, test\SignUpBundle\Document"
is thrown from CollectionPersister class:
...
1
vote
0answers
19 views
How to modify the $base_url, $live_site with .htaccess file?
My problem is i bought a shity hosting and now i can not set my own config.
I need to do it by .htaccess file.
Here is what i manage to do:
RewriteEngine on
RewriteCond %{HTTP_HOST} ...
0
votes
1answer
24 views
Symfony Ajax Controller Handler, always fires jQuery error function
I am really new with Symfony framework I am just trying to implement a simple ajax example:
Routing:
DartDartBundle_data_user:
pattern: /data/user
defaults: { _controller: ...
0
votes
2answers
20 views
Symfony choice field type reports “This value is not valid” when submitting an invalid option. How do I change this?
I've noticed that when using the Symfony 2.3 choice field type, if I try to submit an invalid option (by manually changing the value of an option), symfony reports a form error on that field that says ...
0
votes
1answer
28 views
Datetime zone occasionally converting to UTC and formatting incorrectly
I have an object, and in the constructor for said object I pass another object that is posted from an API. The relevant constructor code is:
$this->timeStamp = new ...
0
votes
0answers
13 views
Why is Symfony2 parsing the entire Forms Collection - Performance issue
I have a Forms Collection in my Symfony2.3 project.
From time to time, I can have up to 200 forms in my collection.
Then, in order to speed up things, I am only submitting some of those 200 forms ...
1
vote
1answer
20 views
How to access user information from view in Symfony2
How can I access to user information (security-context) from view in symfony2. Using PHP, not twig templates.
Thanks in advance.