From: Gustavo Martin Morcuende Date: Tue, 15 May 2012 17:08:14 +0000 (+0200) Subject: Combobox to show the available languages. X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=ec7b39486e8d68860bc48eabde5758560250d833;p=mobi%2F.git Combobox to show the available languages. --- diff --git a/lib/form/doctrine/LanguageListForm.class.php b/lib/form/doctrine/LanguageListForm.class.php new file mode 100644 index 0000000..c2df827 --- /dev/null +++ b/lib/form/doctrine/LanguageListForm.class.php @@ -0,0 +1,37 @@ +useFields(array('id')); + + $this->widgetSchema['id'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getModelName(), + 'add_empty' => false, + 'multiple' => false)); + + $this->validatorSchema['id'] = new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), + 'required' => true, + 'multiple' => false)); + + $this->widgetSchema->setLabels(array('id' => 'Language: ',)); + + //i18n (Internationalization) + //See apps/companyfront/modules/language/i18n/language_select_form.es.xml file (not created yet) + $this->widgetSchema->getFormFormatter()->setTranslationCatalogue('language_select_form'); + + + //Every form must have its own name + $this->widgetSchema->setNameFormat('languageselect[%s]'); + } +}