Re: [symfony-users] help with action preExecute() and forward()

2010-09-01 Thread Syam
Hi, You should use a "component slot". Regards, On 09/01/2010 10:10 AM, Cyrille37 wrote: Hello, After read some posts, I'd learned the rule that one action for one template. So I now need some architect's ideas to solve a case. To fill a slot used in the layout, I call a DB Query in the actio

Re: [symfony-users] prefill login form

2010-03-23 Thread Syam
Extend the sfGuardFormSignin.class.php from sfDoctrineGuardPlugin, and in the configure method, use the setDefault('username', $value) method to what value you want ... example : class signinForm extends sfGuardFormSignin { public function configure() { parent::configure(); $this->set

Re: [symfony-users] Select fields updating other form fields

2010-03-22 Thread Syam
I did this feature on a car site : http://www.groupe-lempereur.com On the upper right, you can find 4 select fields, with the model (modèle) field depending from the mark (marque) field through ajax. *The code :* In action.class.php : --

Re: [symfony-users] how to create a copy of symfony app using a different database

2010-03-22 Thread Syam
"application" : You mean real app in apps/ or complete symfony project to copy ? Peter Peltonen wrote: A newbie question: how do I create a copy of symfony app using a different database? Here is what I tried: 1) copied my symfony 1.2.12 application to another dir to make a copy of it. 2) di

Re: [symfony-users] Symfony routing and _

2010-03-16 Thread Syam
Hi, In your factories.yml application config file, you can use the "segment_separators" option on routing section : all: routing: class: sfPatternRouting param: generate_shortest_url: true extra_parameters_as_query_string: true segment_separators: ['.','/','_'] Hope this

Re: [symfony-users] help il list

2010-03-13 Thread Syam
I am not sure to understand, You want to retreive category from the existing job ? right ? But if this is the case, what about the first record ? You won't have any existing category, does not make sense ... (or you have to display a select input and a free text input, then get the value from

Re: [symfony-users] Doctrine question

2010-03-12 Thread Syam
, class: Profile} //Syam Alexander Deruwe wrote: I have the following yaml schema: Profile: # blah blah Channel: actAs: { Timestampable: ~ } columns: sender_id: { type: integer, notnull: true } receiver_id: { type: integer, notnull: true } relations: Profile: { local

Re: [symfony-users] sfWidgetFormDoctrineChoice problems

2010-03-06 Thread Syam
You have to pass a Doctrine query to the widget, not a Doctrine collection. (Note the "Query" part in my getCampaignsQuery() table method example.) Samuel Morhaim wrote: Syam.. that didnt work it gives me an error. $query = Doctrine::getTable('Campaign')->

Re: [symfony-users] sfWidgetFormDoctrineChoice problems

2010-03-06 Thread Syam
Hi, You can use the sfWidgetFormDoctrineChoice widget with the 'query' option, thus, you can pass params to your query throught the form option system : *In action :* $this->form = new campaignForm($record, array('organization' => $user->organization) // or any param you want from $request o

Re: [symfony-users] Resize images while upload without plugin

2010-02-19 Thread Syam
Hi, You can write your own class extending the sfValidatedFile class and put your code in it. You can found an concrete example on the excellent "Symfony in the Cloud" slides from Kris Wallsmith at sfLive2010 http://www.slideshare.net/kriswallsmith/symfony-in-the-cloud (class example at slid

Re: [symfony-users] sfValidatorChoice always invalid!!

2010-02-19 Thread Syam
You must only pass the keys of your $modulo array to validator : $this->validatorSchema['id_modulo'] = new sfValidatorChoice( array('choices' => array_keys($modulos)) ); wueb wrote: Hi mates, I'm having a problem in this piece of code: $modulos = array ( 1 => "option 1", 2 => "option

Re: [symfony-users] Re: Id being lost on update..

2010-02-18 Thread Syam
If you forgot "echo $form->renderHiddenFields();", then "unset($this["id"])" make sense since the validator don't try to taint the missing value. Can you paste your template code please ? Samuel Morhaim wrote: unseting id worked.. However.. why is this necessary? The generated Crud, did not

Re: [symfony-users] Re: Id being lost on update..

2010-02-18 Thread Syam
Take a look :/ $request->getParameter('id')));/ Don't think it's correct because symfony framework use an array container for submitted values. Regarding your model, you should have something like "campaign[]" POST container. So to get the posted id from current record, and assuming you are