[symfony-users] [Symfony 2] default routes

2010-12-11 Thread dbenjamin
Hi, With Symfony 2, is it required to define a route for each controller action ? Are we able to define a route like : "/foo/:action" with indexAction as the default action ? Thanks. br, Benjamin. -- If you want to report a vulnerability issue on symfony, please send it to security at s

[symfony-users] [Symfony 2 PR4] Auto-discover of translations catalogues

2011-01-10 Thread dbenjamin
Hi, I try to use and understand the Translation component from Symfony 2. I ran some tests and it seems that the fallback system doesn't work properly (maybe it's my mistake). I tried with the following configuration : app.config: translator: enabled: true fallback: en

[symfony-users] Re: [Symfony 2 PR4] Auto-discover of translations catalogues

2011-01-10 Thread dbenjamin
Ok, i figured out that in fact the browser preferred languages are not auto-detected :) -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group.

[symfony-users] [Symfony 2 sandbox] Controller service id convention

2011-01-13 Thread dbenjamin
Hi, I'm trying desperately to use setter injection within a bundle. I have a bundle named "NewsBundle" under src/Bundle/NewsBundle. The NewsBundle adds an Extension to container like (simplified version) : public function configLoad($config, ContainerBuilder $container) { $loade

[symfony-users] [Symfony 2 sandbox] security.xml from a tier Bundle

2011-01-15 Thread dbenjamin
Hi, I would like to configure security layer from a specific Bundle, how can i do that ? I've naively tried to add the following line into app/config.yml : security.config: ~ And then into my bundle extension : public function configLoad($config, ContainerBuilder $container) {

[symfony-users] [Symfony 2/Doctrine 2] Avoiding the damn "Can't connect to local MySQL server through socket '/tmp/mysql.sock" error

2011-01-26 Thread dbenjamin
Hi, I can see that some people get the classic error : "Can't connect to local MySQL server through socket '/tmp/mysql.sock" Most of the time, it comes from a Zend Server environment. Here is how i was able to solve this : Create a symlink from "/tmp/mysql.sock" to "/var/run/mysqld/mysqld.sock"

[symfony-users] [Symfony 2 / Twig] Design issue for templates in a CMS context

2011-02-12 Thread dbenjamin
Hi, I just can't find a way to achieve an use case with a modular project and Twig. Maybe i'm missing something. Let's consider a CMS context and a NewsBundle bundle ("module"). The user can create a page in his website structure, i.e : "News item page". Then he can assign a layout (a presentat

[symfony-users] [Symfony 2.0.0BETA1] Validation namespaces config/custom validator

2011-05-05 Thread dbenjamin
Hi, I try to use a custom validator, but i didn't found a way :) First, i use xml for validation and I'm not sure how to add properly a namespace in the config file. I naively tried to do the same as for annotations or yml drivers: validation: enabled: true annotations: namespa

Re: [symfony-users] [Symfony 2.0.0BETA1] Validation namespaces config/custom validator

2011-05-06 Thread dbenjamin
Thanks Stof. I looked at the FOSUserBundle validators but in the validation.xml file, the custom constraints are defined outside the properties, and the property is a parameter of the validator. I would like to attach my validator directly to the property just like any other validator :

Re: [symfony-users] [Symfony 2.0.0BETA1] Validation namespaces config/custom validator

2011-05-09 Thread dbenjamin
Hi, I'm still stuck with that :/ Did anyone manage to make this work ? Thanks, * -- Benjamin Dulau - anonymation CEO anonymation.com | code.anonymation.com ben...@anonymation.com * -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com Y

[symfony-users] [v2.0.0BETA1] Overriding bundle translations

2011-05-10 Thread dbenjamin
Hi, In Sf2, the system to override templates through a child bundle is great because it naturally organizes the files in a logic way (and inside the src directory). But i wonder why the same mechanism is not applied to the translation files ? Or maybe i'm not using it well. Take the FOSUserBun

[symfony-users] [v2.0.0BETA1] Array data and validation with Forms

2011-05-17 Thread dbenjamin
Hi, I saw a commit adding a way to specify the form constraint on the fly : http://goo.gl/begfs In the commit i see also a new attribute : >setAttribute('validation_constraint', $options['validation_constraint']) And that's what i'm interested in. My form Type is defined as a service, and i wo

Re: [symfony-users] [v2.0.0BETA1] Array data and validation with Forms

2011-05-19 Thread dbenjamin
Hi Bernhard, Thanks for your response. Can i define form validation constraints from my XML file, when i'm defining the service ? ??? * -- Benjamin Dulau - anonymation CEO anonymation.com | code.anonymation.com ben...@a

[symfony-users] [Sf2] Localize Birthday Form Type widget

2011-05-24 Thread dbenjamin
Hi, I'm testing the birthday Form Type, and even if my current locale is "en", the widget shows days in French (system language). Is this a bug or is there a way to localize the widget ? Thanks. * -- Benjamin Dulau - anonymation CEO anonymation.com | code.anonymation.com ben...@anonymation.c

[symfony-users] [Sf2] Security : Retrieving user and password

2011-05-24 Thread dbenjamin
Hi, I see that the password is not hydrated when retreiving user through security context. But when a provider fetches the user from a database, not having the password forces the developper to execute an extra request just to be able to save the user without a null password. I know that's a

[symfony-users] Re: Security : Retrieving user and password

2011-05-24 Thread dbenjamin
I've found why the password is erased. That's the AuthenticationProviderManager which calls the eraseCredentials() method or not on the User class just after authentication according to the $eraseCredentials option passed to the constructor. And in my eraseCredentials() implementation i was set

[symfony-users] [Assetic] How to deal with images references in CSS

2011-06-02 Thread dbenjamin
Hi, I started to use Assetic and that's really a great tool ! However, i wonder how to deal with images referenced in some CSS files. Take jQuery UI for instance, the bundle comes with a css file and an "images" dir next to it. All images in the css are referenced by 'images/.'. How to dea

Re: [symfony-users] [Assetic] How to deal with images references in CSS

2011-06-02 Thread dbenjamin
Ok, i added the cssrewrite filter to my assets but i'm not sure how to use it. {% stylesheets filter='cssrewrite,?yui_css' '@MvalSiteBundle/Resources/css/jquery/jquery-ui.css' '@MvalSiteBundle/Resources/css/reset.css' '@MvalSiteBundle/Resources/css/style.css' %}

[symfony-users] [Beta4][Form] CollectionType and arrays

2011-06-09 Thread dbenjamin
Hi, I wonder how to deal with specific arrays and CollectionType field. Suppose we have the following entity : class Foo { /* @var array */ protected $socialLinks = array( 'linkedIn' => null, 'viadeo' => null, 'twitter' => null, ); } And the following fiel

[symfony-users] Re: [Beta4][Form] CollectionType and arrays

2011-06-10 Thread dbenjamin
In fact, that was easy :-) $builder->add('socialLinks', new SocialLinksType()); SocialLinksType : $builder ->add('linkedIn', 'text') ->add('viadeo', 'text') ->add('twitter', 'text'); Works like a charm ! Benjamin. -- If you want to report a vulnerability issue on symfony, please

[symfony-users] [Beta4] Handle file upload with array data

2011-06-15 Thread dbenjamin
Hi, I'm trying to handle multiple file uploads with a binded array. // FilesType $builder ->add('photo1', 'file', array(type' => 'file')) ->add('photo2', 'file', array('type' => 'file')) ->add('photo3', 'file', array('type' => 'file')) ; // controller $files = array( 'photo1' =>