Re: [symfony-users] Re: (Newbie) Problem with validation: all fields REQUIRED on example form from book

2010-12-14 Thread Erkhembayar Gantulga
hi, gfranzini I think that reading practical symfony is great point to start and understand fundamental concepts. It's not boring long reading, After you read several chapter you'll feel how rock symfony is . Good luck for your study. Keep going. Erkhembayar -- If you want to report a vulnerab

Re: [symfony-users] Re: using partials in i18n forms and credentials for i18n forms

2010-12-14 Thread Daniel Lohse
You passed the user object as the first parameter – please read my email again. :) The first parameter has to be an Events object or null. Cheers, Daniel On 14.12.2010, at 15:57, P-A Coipeault wrote: > Hi Daniel. > > I tried to instanciate my form the way you suggested but i only get > that 5

Re: [symfony-users] Re: autoloading

2010-12-14 Thread Tim Nagel
You need to install the intl module http://www.php.net/manual/en/intl.installation.php t 2010/12/15 Carlos Sánchez > Hello > > I have this same problem, JF Simon answer does not help me (NEWBIE), > bit more explicit pls!!!. > > Thanks in advanced. > > On Dec 7, 6:04 pm, JF Simon wrote: > > T

[symfony-users] [ErrorException] Notice: Undefined index: strategy in YamlDriver.php line 163

2010-12-14 Thread Carlos Sánchez
Hi all, I'm completely new at symfony (any version) and i'm playing with symfony 2.0. I just clone the last (14 dic) sandbox form github repository. I'm trying to create a new entity (using anotation) and use doctrine:generate:schema to create the SQL sentences. I've created the following php clas

[symfony-users] Re: using partials in i18n forms and credentials for i18n forms

2010-12-14 Thread P-A Coipeault
Hi Daniel. I tried to instanciate my form the way you suggested but i only get that 500 error : The "EventsForm" form only accepts a "Events" object. I also tried another way, by overriding the executeNew() method and assigning my user object to the form object like that : $this->form->user = $thi

[symfony-users] Re: autoloading

2010-12-14 Thread Carlos Sánchez
Hello I have this same problem, JF Simon answer does not help me (NEWBIE), bit more explicit pls!!!. Thanks in advanced. On Dec 7, 6:04 pm, JF Simon wrote: > This is a PHP class from intl > modulehttp://www.php.net/manual/en/numberformatter.create.php > > On 4 déc, 17:02, Jay Bs wrote: > > >

[symfony-users] sfDependentSelectPlugin multiple instances of the same model

2010-12-14 Thread pbkyriak
Hi all, sfDependentSelectPlugin is a great plugin and I use it. But from the documentation I cant figure the following case. Let's say we a form with state-city dependent selectboxes, but we have invoice address, delivery address and alternative address. That means that we have 2 sets of state-city

[symfony-users] Re: SfGuardPlugin and schema.yml

2010-12-14 Thread codecowboy
If I rebuild my models, the sfGuard models return but if I try to login, I get the error: Unknown method SfGuardUserTable::retrieveByUsername If I delete the models from lib/model, I don't get the error and everything works. Any ideas? On Dec 14, 9:13 am, Alexandre Salomé wrote: > Files are ge

[symfony-users] Using a database with database triggers and database functions in Symfony

2010-12-14 Thread Andre Lopes
Hi, I'm coding the Jobeet example from the Symfony website but I'm with some doubts about a subject... For my projects I use PostgreSQL Database, and in all my projects I end up with a Database with a lot of Triggers and Functions. How can I deal with this subject with the "schema.yml" and the "s

Re: [symfony-users] 2 Classes for each Database Table, what to put in each one?

2010-12-14 Thread Andre Lopes
Thanks for the reply. No I'm getting it! Best Regards, On Tue, Dec 14, 2010 at 12:16 PM, Stefan Paschke wrote: > yes you can: > http://www.symfony-project.org/gentle-introduction/1_4/en/08-Inside-the-Model-Layer-Doctrine#chapter_08_sub_object_and_table_classes > > On Dec 14, 2010, at 1:02 PM,

Re: [symfony-users] 2 Classes for each Database Table, what to put in each one?

2010-12-14 Thread Alex Pilon
getActiveJobs() is on the JobeetJobTable class because in the context of calling that method, those jobs aren't attached to any other entity. You have no data currently loaded and you want to load only active ones. The category getActiveJobs() is working off the basis of getting active jobs *in th

Re: [symfony-users] 2 Classes for each Database Table, what to put in each one?

2010-12-14 Thread Andre Lopes
Hi, I have read the text, but I can't figure out the following: In the example with Jobeet website: I have the "public function getActiveJobs()" in the JobeetJobTable.class.php and then I have the "public function getActiveJobs()" in the JobeetCategory.class.php What is the reason for this? In

Re: [symfony-users] Test suite of symfony 2

2010-12-14 Thread Alessandro Nadalin
2010/12/14 Fabien Potencier : > On 12/14/10 1:21 PM, Alessandro Nadalin wrote: >> >> Hi Fabien, >> >> 2010/12/14 Fabien Potencier: >>> >>> You must use the latest stable version of PHPUnit. >> >> Sorry, terrible mistake of mine. >> >> But after upgrading to 3.5.5 I get, as previously: >> >> PHP Fat

Re: [symfony-users] Test suite of symfony 2

2010-12-14 Thread Fabien Potencier
On 12/14/10 1:21 PM, Alessandro Nadalin wrote: Hi Fabien, 2010/12/14 Fabien Potencier: You must use the latest stable version of PHPUnit. Sorry, terrible mistake of mine. But after upgrading to 3.5.5 I get, as previously: PHP Fatal error: Cannot redeclare class FooClass in /var/www/symfony

Re: [symfony-users] Re: (Newbie) Problem with validation: all fields REQUIRED on example form from book

2010-12-14 Thread Gareth McCumskey
In my personal opinion there is nothing wrong with creating a form in an action. The simple fact is that creating web apps you often end up with a scenario where you need to create a quick little, 2-3 field form and having to create a full form class extending sfForm just isn't practical. In additi

[symfony-users] Re: (Newbie) Problem with validation: all fields REQUIRED on example form from book

2010-12-14 Thread gfranzini
Hello Jamie, OK, I followed your instructions and they DO work. The only substantial difference I see from the code in the book, apart from separating the form from the action, is that setNameFormat() can only be used with a form in lib/form, not in one inside an action. Am I right? However, the b

Re: [symfony-users] Test suite of symfony 2

2010-12-14 Thread Alessandro Nadalin
Hi Fabien, 2010/12/14 Fabien Potencier : > You must use the latest stable version of PHPUnit. Sorry, terrible mistake of mine. But after upgrading to 3.5.5 I get, as previously: PHP Fatal error: Cannot redeclare class FooClass in /var/www/symfony2/tests/Symfony/Tests/Component/DependencyInject

Re: [symfony-users] 2 Classes for each Database Table, what to put in each one?

2010-12-14 Thread Stefan Paschke
yes you can: http://www.symfony-project.org/gentle-introduction/1_4/en/08-Inside-the-Model-Layer-Doctrine#chapter_08_sub_object_and_table_classes On Dec 14, 2010, at 1:02 PM, Andre Lopes wrote: > There are 2 classes for each Table, for example: > > JobeetJob.class.php and JobeetJobTable.class.p

[symfony-users] 2 Classes for each Database Table, what to put in each one?

2010-12-14 Thread Andre Lopes
There are 2 classes for each Table, for example: JobeetJob.class.php and JobeetJobTable.class.php What is the difference between the two, what I must put in each one? Can I find an answer for this online? Best Regards, -- If you want to report a vulnerability issue on symfony, please send it

Re: [symfony-users] Test suite of symfony 2

2010-12-14 Thread Fabien Potencier
You must use the latest stable version of PHPUnit. -- Fabien Potencier Sensio CEO - symfony lead developer sensiolabs.com | symfony-project.org | fabien.potencier.org Tél: +33 1 40 99 80 80 On 12/14/10 11:00 AM, Alessandro Nadalin wrote: Hi Fabien, 2010/12/14 Fabien Potencier: Which version o

Re: [symfony-users] Re: (Newbie) Problem with validation: all fields REQUIRED on example form from book

2010-12-14 Thread Gareth McCumskey
You do not need to add the setNameFormat parameter. On your action where the form gets posted to: $posted = array( 'name' =>$request->getParameter('name'), 'email' =>$request->getParameter('email'), 'subject' => $request->getParameters('subject'),, 'message' =>$request->getParameter('messa

[symfony-users] Re: (Newbie) Problem with validation: all fields REQUIRED on example form from book

2010-12-14 Thread gfranzini
Thank you Gareth, You are right, if I set ALL fields to "required"=>false I get no errors. But if I put the name as "required"=>true, the form fails validation even if I enter a value. Maybe I need the fix proposed by Erkhembayar too, If only I could get it to work. As this was just the first expe

[symfony-users] Re: (Newbie) Problem with validation: all fields REQUIRED on example form from book

2010-12-14 Thread Flukey
Hi, I know it says in the book that you can create a form on the fly in an action, but this is really bad practice. Even if you try setting the name format for the form with "$this->form- >widgetSchema->setNameFormat('contact[%s]')" you'll get thrown an error because this is a protected property

[symfony-users] Re: (Newbie) Problem with validation: all fields REQUIRED on example form from book

2010-12-14 Thread gfranzini
Hello Erkhembayar, Thank you. But after following your suggestion, if I try to display the form I get the following: Fatal error: Call to undefined method sfForm::setNameFormat() in C:\dev \sfproject\apps\frontend\Modules\Investigator\actions \contactAction.class.php on line 12 On Dec 14, 2:18

Re: [symfony-users] Test suite of symfony 2

2010-12-14 Thread Alessandro Nadalin
Hi Fabien, 2010/12/14 Fabien Potencier : > Which version of PHPUnit do you use? phpunit --version: PHPUnit 3.5.0RC2 by Sebastian Bergmann. Following some hints of the italian symfony ML I've tried to use the vPR4 tag ( instead of the master ) on the Git repo, but the, frustrating :), error that

Re: [symfony-users] Re: (Newbie) Problem with validation: all fields REQUIRED on example form from book

2010-12-14 Thread Gareth McCumskey
The problem are your validators. symfony by DEFAULT marks ALL fields as required unless you tell it otherwise. So your validators should like this: $this->form->setValidators(array( 'name' => new sfValidatorString(array("required"=>false)), 'email' => new sfValidatorEmail(ar

Re: [symfony-users] SfGuardPlugin and schema.yml

2010-12-14 Thread Alexandre Salomé
Files are generated in project because Guard is a part of your model. Generated classes should stay in the lib/model folder. You cannot move them or they will be regenerated. Any symfony developer will look in this folder. This place is the "place to be". Tell us if you solved your problem. --- Al

Re: [symfony-users] Best practice to use Eclipse PDT and symfony?

2010-12-14 Thread Stéphane
Hello, In Eclipse, you can add settings in Window->Preference>Validation, Then select the validation you wish to configure. Here you'll be able to add exclusion filters, adding the workspace directory you want (then select symfony directory). It will not be validated any more, for selected valida

[symfony-users] SfGuardPlugin and schema.yml

2010-12-14 Thread codecowboy
Hi, I'm new to symfony and am using the sfDoctrineGuardPlugin. I got it working by adapting the procedure from the jobeet tutorial. However, when I re-build my models, duplicate sfDoctrineGuardPlugin classes are added to lib/model. I assume this is because the sfDoctrineGuardPlugin tables are now

[symfony-users] Re: using partials in i18n forms and credentials for i18n forms

2010-12-14 Thread P-A Coipeault
Thanks a lot Daniel ! That's really helpfull :) So, one point resolved above two is resolved. Thanks again. Cheers, P-A On Dec 14, 12:25 am, Daniel Lohse wrote: > You can pass the user as an option to the form from the action — just pass an > array as the second parameter of the form instancia

Re: [symfony-users] Re: (Newbie) Problem with validation: all fields REQUIRED on example form from book

2010-12-14 Thread Erkhembayar Gantulga
Hi, I think that in order to validate your form you need to put $this->form->setNameFormat('contact[%s]'); for that form. After your post in, $this->form->bind($request->getParameter('contact')); it doesn't have correct value to validate. It would be help you. Cheers. Erkhembayar Gantulga On M

Re: [symfony-users] How to validate in model at form submission

2010-12-14 Thread Erkhembayar Gantulga
Hi, himanshu You can validate it using postValidator in form. Or you can put restrict in your your form using jQuery datepicker if you want. I don't understand that validate in model level. All possible to implement. Have a good day. Erkhembayar Gantulga On Mon, Dec 13, 2010 at 9:03 PM, himans

Re: [symfony-users] Best practice to use Eclipse PDT and symfony?

2010-12-14 Thread Eric B
Sure - Eclipse shows icons on files with errors, but when you have a large tree (like you do with symfony), it is tough to see the individual errors all the time. Furthermore, it is a lot easier to see in the console that you have errors when it is "clean" and not cluttered with 1000+ errors and w

Re: [symfony-users] Test suite of symfony 2

2010-12-14 Thread Fabien Potencier
Which version of PHPUnit do you use? -- Fabien Potencier Sensio CEO - symfony lead developer sensiolabs.com | symfony-project.org | fabien.potencier.org Tél: +33 1 40 99 80 80 On 12/13/10 12:43 PM, odino wrote: Hi guys, I was trying to fix a bug on Sf2 tracker. To do that I needed to build the