Questions tagged [symfony-2.0]
This is the Symfony 2.0.x specific tag. Use it in addition to the symfony2 tag if your question is specific to Symfony 2.0.x — not just 2.x.
52
questions
0
votes
0
answers
570
views
Cannot find module 'less' though less is present
I know this question had been asked a few times already, but I tried everything I found and nothing worked, so I'll ask directly
I have a symfony 2.0 project, in which I'm building a docker
But ...
2
votes
1
answer
62
views
Migrate Symfoy 2.0.15 app to newest release, the right way
I have a project (developed by others) running on Symfony 2.0.15 and I need to upgrade it to newest Symfony2 version cause I need to add some new code and it's been hard to get it done. I can't find ...
0
votes
1
answer
544
views
Installing behat on a Symfony 2.0 project using deps - what versions?
I have a legacy Symfony 2.0 project (version 2.0.11 to be precise) to which I'd like to add behat tests. As it's Symfony 2.0, it uses the deps vendor system rather than composer. I'm not in a ...
0
votes
1
answer
67
views
add custom options to a form
I'd like to pass an option to my form so I did this:
$builder
->add('pays', 'collection', array(
'type' => new PaysType(),
...
0
votes
2
answers
358
views
Using symfony 2.0.x form component standalone
How does one use the symfony-form component standalone for version 2.0.*? The examples in the documentation show how to create forms, but they use other parts of the symfony ecosystem, like ...
0
votes
1
answer
123
views
Cannot find login_check
Unable to find the login_check in symfony2.0 (I know it should be symfony2.4 because it is decrypted, but my customer wants 2.0).
What is wrong that symfony cannot finde the login_check-path?
My ...
3
votes
1
answer
1k
views
Add phpexcel to my project
I need to generate Excel files, I did a search and phpexcel seems to be good and stable. I'd like to know:
* how to integrate it into my project given that it's a symfony2.0 project
* if I can do all ...
1
vote
1
answer
554
views
Symfony2.0 form date with today
I create a form in symfony2.0 and read some articles here. But all doesn't work.
I want to create a form field with the type date and the date should be today. What is wrong?
->add('...
0
votes
1
answer
37
views
Custom symfony2 form
I have three entities, fos_user, command and preference. The user can send himself an email containing a specific field from each entity, these fields can't be empty. So when the user decides to send ...
4
votes
1
answer
210
views
Using composer.json in Symfony 2.0
I have a Symfony 2.0 project; however, I'd like to switch from deps to composer.json without going up to 2.1+. Has anyone done this, or is there anything that would prevent this from working?
1
vote
2
answers
656
views
How to checkout old Symfony 2.0.23 version with Vendors
I'm trying to update the old server, which runs Symfony 2.0.X and vendors to the latest version 2.0.23 with Vendors.
Unfortunatelly I can't find anywhere I can find Symfony 2.0.23 with vendors. On ...
0
votes
0
answers
39
views
how to use a 3rd security option in symfony2 secured login
I am using symfony2.0 secured login for my login page.
I have a column name blockstatus in my login table which contains value 1 (blocked user) or 0 (active user).
I need to check username, password ...
4
votes
1
answer
4k
views
Edit multiple Entity Objects in one form
I have table with this fields:
id, ch1, ch2, .., ch15
and 62 lines (id = 1 upto 62, and other fields = 0 by default). I need to create single form, where i can edit (not insert nor delete) all ch1-...
11
votes
1
answer
20k
views
Doctrine2 LEFT JOIN with 2 conditions
I'm trying to find a 'Product' by ID, and to left join all it's 'Photo' on two conditions: the locale AND the active state.
Here's my QueryBuilder :
$queryBuilder = $this->createQueryBuilder('p')
...
3
votes
1
answer
1k
views
symfony2.0.0 get locale in security.yml
I'm using symfony2.0.0. I don't have a chance to update symfony.
This is my security.yml
firewalls:
main:
logout: true
pattern: .*
http_basic: true
...
1
vote
1
answer
649
views
Symfony2: "Invalid Schema" in CRUD edit view
We have a site that is running version 2.0.17 of Symfony (yes, we know it's obsolete, migration to 2.2.x is underway). It has worked fine until a few days ago, when we started to get an error 500 with ...
17
votes
4
answers
25k
views
Disable CSRF token on login form
I am using Symfony2.0 and FOSUserBundle, and would like to disable the csrf token on my login form.
I have disabled the csrf protection globally on my website in my config.yml:
framework:
...
0
votes
1
answer
288
views
Steps to create Multiple database in symfony 2.0
I am using single database connection. Now I need to use two database connection. I need to know the steps to create two databases. I have lot of doubts. Generate entity commands are same what we ...
0
votes
1
answer
870
views
symfony 2.0.22 request header null
I was working with symfony 2.0.12 but I have this problem: the page is not updated, always returns null.
public function cambiarlocaleAction($idioma)
{
$this->get('session')->setLocale($...
0
votes
1
answer
129
views
Add Class into uses section in Propel behavior
That's it. I created behavior and only some of its classes are added into head with use due to my behavior.
E.g. behavior creates new table named acme. Propel generator adds to my Foo class (app/...
0
votes
1
answer
3k
views
How to validate subforms of an entity-mapped form in Symfony2?
I've got a form that is mapped to an entity ('data_class' => ...). I've got validators set up (via annotations) on the entity's properties.
The entity has a property (nameTranslations) of doctrine'...
0
votes
2
answers
2k
views
Binding request to a form does not work for collection type
I don't use any ORM for entities. This form is built for sending email only.
In my Controller I have this:
$builder = $this->myHelper
->createBuilder('form', null)
->...
0
votes
1
answer
263
views
How to create edit/update form
I try make edit form in Symfony
public function editAction()
{
$id = 5;
$em = $this->getDoctrine()->getEntityManager();
$request = $this->get('request');
$entity = $em-&...
0
votes
1
answer
4k
views
urlencode in twig path function
I have this route:
_view_tag:
pattern: /topic/{tid}
defaults: {_controller: "MyCoreBundle:ViewTag:index" }
And I want to show url like this: example.com/topic/Web+development. I use href="...
1
vote
1
answer
248
views
Executing R scripts in Symfony2
I have to execute (safely) a lot of R scripts from a Symfony2 controller.
I organized in my AcmeStatsBundle a folder named RScripts. There, a lot of R script files are stored, e.g. Test.R
To execute ...
2
votes
1
answer
5k
views
Add Parameter to symfony2 Request deep array
I want to add a parameter to the ParameterBag in a symfony2 Request.
So the array looks like this:
array (size=2)
'editor' =>
array (size=6)
'_token' => string '...
1
vote
1
answer
997
views
Embedding a Single Object
I am new to Symfony2.0. I am learning it from the site http://symfony.com/doc/2.0/book/index.html. I've gone through all the topics given in the site but i am not getting output for the topic '...
2
votes
1
answer
346
views
Symfony 2 Locale Case Sensitive
I am using symfony 2.0 for a development, m using the locale names as for example, en_ZA, en_US, en_QA for different languages, Have set en_ZA as default locale using Config.yml,
My urls are called ...
2
votes
3
answers
8k
views
Install JMSSerializerBundle
I installed FOSRestBundle but it needs JMSSerializerBundle.
I added in my deps the next lines:
[JMSSerializerBundle]
git=git://github.com/schmittjoh/JMSSerializerBundle.git
target=bundles/...
15
votes
3
answers
21k
views
How to disable profiler in Symfony2 in production?
How to disable profiler in Symfony2 in production?
I do not mean the toolbar - I mean the profiler.
I want to disable it in production, I use it extensively for development so the solution with ...
2
votes
1
answer
2k
views
Programmatically logout current user
I am trying to programmatically logout the current user from inside a listener.
I read here that
$this->get('security.context')->setToken(null);
$this->get('request')->getSession()->...
0
votes
2
answers
2k
views
External Class is not autoloaded in symfony2.0 project
I want to add EasyCSV to my symfony2 project https://github.com/jwage/EasyCSV
This is what I tried. I added
'EasyCSV' => __DIR__.'/../vendor/easy-csv',
to autoload.php and
use EasyCSV\...
1
vote
1
answer
2k
views
How to deploy symfony2 - my dev env works but not prod
I have read the cookbook regarding deploying my symfony2 app to production environment. I find that it works great in dev mode, but the prod mode first wouldn't allow signing in (said bad credentials ...
2
votes
2
answers
98
views
Updating symfony 2.0.0-DEV to newer version
I have a symfony-project (2.0.0-DEV = RC5) which i want to upgrade to the latest version (2.0.18).
If i just copy my bundles with some changes (for example autoloading path) it still don't work and ...
0
votes
1
answer
336
views
Character Set Issues when Upgrading from Symfony 2.0.* to Symfony 2.1.*?
I have recently upgraded my staging test site to the latest version of Symfony and updated all the vendors using composer as instructed in the upgrade document that comes with the download.
...
2
votes
2
answers
4k
views
Show mysql blob pdf file in Symfony 2.0
I have a link:
{% for item in list %}
...
<a href="{{ path('show', { 'id': item.id }) }}"> read pdf file</a>
{% endfor %}
When the user clicks the link I would ...
1
vote
2
answers
197
views
Impossible to customise error message on email field on Sf2
I modify my code to follow @Stony advices.
I would like to customise my email input error. I try to follow the symfony2 tutorial but it doesn't work.
I follow symfony validation tutorial and I ...
2
votes
5
answers
8k
views
Symfony2 Validating an optional field
In my form, I have a field with required option set to false, this field is optional.
However, I would like to have a notBlank validation on this field when the field is used:
@Assert\NotBlank(
* ...
2
votes
1
answer
2k
views
Class 'Symfony\Component\HttpKernel\DependencyInjection\ConfigurableExtension' not found
After installing JMS Serializer Bundle following the provided instructions using the deps file, I get the following error:
Fatal error: Class 'Symfony\Component\HttpKernel\DependencyInjection\...
25
votes
2
answers
14k
views
JMSSerializerBundle. no control over third party meta data
I have two entities I wish to serialize with the JMSSerializerBundle. The Music Entity has a mapping-file with exclusion_policy: NONE.
The Music entity has a field of the entity User from ...
0
votes
2
answers
1k
views
Fatal Error when installing stof bundle and doctrine extensions (tree)
Here is the problem : I don't succeed to install stof bundle with symphony 2.0
How I proceed :
I add this lines in deps file :
[GedmoDoctrineExtensions]
git=https://github.com/l3pp4rd/...
6
votes
1
answer
7k
views
Symfony2 bin/vendors
When i try to run the following command from my Symfony2 project root
php bin/vendors install
I get the following error:
Could not open input file: bin/vendors
I'm completely new to git and ...
2
votes
0
answers
813
views
Symfony2 security - Strange behavior (Challenging issue)
Using FOSOauthServerBundle, FOSUserBundle and Symfony2.0, I have followed this documentation (http://blog.logicexception.com/2012/04/securing-syfmony2-rest-service-wiith.html) about creating an own ...
0
votes
2
answers
538
views
Integrate EWZRecaptchaBundle on symfony framework
I try to integrate the EWZRecaptchaBundle to my site (based on the symfony framework) but this exception prevents me from completing my job. I don't know the problem.
Fatal error: Declaration of EWZ\...
3
votes
3
answers
9k
views
Symfony2: How to deploy in subdirectory (Apache)
What is the best way to deploy symfony2 application in a subdirectory or an alias ?
Lets say that my application will run under: http://domain/symfonytest
symfonytest is an alias to some directory ...
1
vote
2
answers
745
views
What version of doctrine-mongodb-odm should I use with Symfony2 v2.0.12?
After some trial and error (ok, just error) I figured out that c089b69c3d contained something that broke my code, causing
Fatal error: Interface 'Doctrine\Common\Persistence\Proxy' not found
but the ...
2
votes
2
answers
3k
views
Symfony 2 form prototypes within prototypes - double $$name field
I need some help with prototypes that are within prototypes. Symfony is very clever with generating form prototypes, but once you are one layer down (i.e. prototypes within prototypes), it reuses $$...
1
vote
1
answer
528
views
How can I upgrade a Symfony2 app that is hosting my site?
I maked site on 2.0.7, today's actual version is 2.0.9. And I'm quite new to Symfony2.
How I can upgrade my Symfony app without any problems?
6
votes
1
answer
5k
views
Symfony2 add reCaptcha field to registration form
I'm trying to add EWZRecaptcha to my registration form.
My registration form builder looks something like this:
public function buildForm(FormBuilder $builder, array $options)
{
$builder->add('...
0
votes
2
answers
936
views
Configuring MongoDB + doctrine in Symfony
I was trying to install MongoDB doctrine bundle as written in here
But when I ran the command
$ php bin/vendors install
It throws up the following error:
Fatal error: Call to undefined method
...