當前位置: 首頁>>代碼示例>>PHP>>正文


PHP BaseForm::setup方法代碼示例

本文整理匯總了PHP中BaseForm::setup方法的典型用法代碼示例。如果您正苦於以下問題:PHP BaseForm::setup方法的具體用法?PHP BaseForm::setup怎麽用?PHP BaseForm::setup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在BaseForm的用法示例。


在下文中一共展示了BaseForm::setup方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setup

 public function setup()
 {
     $this->widgetSchema['email_address'] = new sfWidgetFormInputText();
     $this->validatorSchema['email_address'] = new sfGuardValidatorUsernameOrEmail(array('trim' => true), array('required' => 'Your username or e-mail address is required.', 'invalid' => 'Username or e-mail address not found please try again.'));
     $this->widgetSchema->setNameFormat('forgot_password[%s]');
     parent::setup();
 }
開發者ID:streamlinesocial,項目名稱:sfDoctrineGuardPlugin,代碼行數:7,代碼來源:BasesfGuardRequestForgotPasswordForm.class.php

示例2: setup

 public function setup()
 {
     $this->setWidgets(array('importer' => new sfWidgetFormChoice(array('choices' => self::$importers, 'expanded' => false)), 'file' => new sfWidgetFormInputFile()));
     $this->setValidators(array('importer' => new sfValidatorChoice(array('choices' => array_keys(self::$importers))), 'file' => new sfValidatorFile(array('required' => true, 'max_size' => 100000, 'path' => sfConfig::get('sf_upload_dir') . '/imports', 'mime_types' => 'gps_files', 'mime_categories' => array('gps_files' => array('application/octet-stream'))))));
     $this->widgetSchema->setNameFormat('import[%s]');
     $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
     parent::setup();
 }
開發者ID:limitium,項目名稱:uberlov,代碼行數:8,代碼來源:ImportForm.class.php

示例3: setup

 public function setup()
 {
     $lI18n = sfContext::getInstance()->getI18N();
     $this->setWidgets(array('single_code' => new sfWidgetFormInputText(), 'multiple_codes' => new sfWidgetFormTextarea()));
     $this->setValidators(array('single_code' => new sfValidatorString(array("required" => false, 'trim' => true)), 'multiple_codes' => new sfValidatorString(array("required" => false, 'trim' => true))));
     $this->widgetSchema->setNameFormat('coupon[%s]');
     parent::setup();
 }
開發者ID:42medien,項目名稱:spreadly,代碼行數:8,代碼來源:CouponCodesForm.php

示例4: setup

 /**
  * @see sfForm
  */
 public function setup()
 {
     parent::setup();
     $this->setWidgets(array('username' => new sfWidgetFormInputText(), 'password' => new sfWidgetFormInputPassword(), 'remember' => new sfWidgetFormInputCheckbox()));
     $this->setValidators(array('username' => new sfValidatorString(), 'password' => new sfValidatorString(), 'remember' => new sfValidatorBoolean()));
     $this->setName('signin');
     $this->validatorSchema->setPostValidator(new dmValidatorUser());
 }
開發者ID:theolymp,項目名稱:diem,代碼行數:11,代碼來源:DmSigninBaseForm.php

示例5: setup

 public function setup()
 {
     $this->setWidgets(array('Nom' => new sfWidgetFormInputText(array(), array('style' => 'width:400px')), 'Cognoms' => new sfWidgetFormInputText(array(), array('style' => 'width:400px')), 'Telefon' => new sfWidgetFormInputText(array(), array('style' => 'width:400px')), 'Email' => new sfWidgetFormInputText(array(), array('style' => 'width:400px')), 'Missatge' => new sfWidgetFormTextarea(array(), array('style' => 'width:400px'))));
     $this->setValidators(array('Nom' => new sfValidatorString(), 'Cognoms' => new sfValidatorString(), 'Telefon' => new sfValidatorString(), 'Email' => new sfValidatorString(), 'Missatge' => new sfValidatorString()));
     $this->widgetSchema->setLabels(array('Nom' => 'Nom: ', 'Cognoms' => 'Cognoms: ', 'Telefon' => 'Telèfon: ', 'Email' => 'Correu electrònic: ', 'Missatge' => 'Missatge: '));
     $this->widgetSchema->setNameFormat('consulta[%s]');
     $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
     parent::setup();
 }
開發者ID:nagiro,項目名稱:intra,代碼行數:9,代碼來源:ConsultaForm.class.php

示例6: setup

 /**
  * @see sfForm
  */
 public function setup()
 {
     $this->setWidgets(array('username' => new sfWidgetFormInputText(), 'password' => new sfWidgetFormInputPassword(array('type' => 'password')), 'remember' => new sfWidgetFormInputCheckbox()));
     $this->setValidators(array('username' => new sfValidatorString(), 'password' => new sfValidatorString(), 'remember' => new sfValidatorBoolean()));
     if (sfConfig::get('app_sf_guard_plugin_allow_login_with_email', true)) {
         $this->widgetSchema['username']->setLabel('Username or E-Mail');
     }
     $this->validatorSchema->setPostValidator(new sfGuardValidatorUser());
     $this->widgetSchema->setNameFormat('signin[%s]');
     parent::setup();
 }
開發者ID:jmiridis,項目名稱:atcsf1,代碼行數:14,代碼來源:BasesfGuardFormSignin.class.php

示例7: setup

 public function setup()
 {
     $this->widgetSchema->setNameFormat('contacto[%s]');
     $this->setWidget('nombre', new sfWidgetFormInput());
     $this->setValidator('nombre', new sfValidatorString(array('required' => true), array('required' => 'Se requiere ingresar un nombre')));
     $this->setWidget('email', new sfWidgetFormInput());
     $this->setValidator('email', new sfValidatorEmail(array('required' => true), array('required' => 'Se requiere una direccion de e-mail')));
     $this->setWidget('comentario', new sfWidgetFormTextarea());
     $this->setValidator('comentario', new sfValidatorString(array('required' => true), array('required' => 'Se requiere un comentario')));
     parent::setup();
 }
開發者ID:nestorfsandoval,項目名稱:2012_pw2_tp2,代碼行數:11,代碼來源:ContactoForm.class.php

示例8: setup

 public function setup()
 {
     $typeChoices = array('' => '', 'mysql' => 'MySQL', 'sqlite' => 'Sqlite', 'pgsql' => 'PostgreSQL', 'oracle' => 'Oracle Adapter', 'oci' => 'Oracle PDO', 'mssql' => 'MsSQL');
     $this->setWidgets(array('type' => new sfWidgetFormChoice(array('choices' => $typeChoices)), 'host' => new sfWidgetFormInput(), 'name' => new sfWidgetFormInput(), 'username' => new sfWidgetFormInput(), 'password' => new sfWidgetFormInputPassword()));
     $this->setValidators(array('type' => new sfValidatorChoice(array('required' => false, 'choices' => array_keys($typeChoices))), 'host' => new sfValidatorString(array('required' => false)), 'name' => new sfValidatorString(array('required' => false)), 'username' => new sfValidatorString(array('required' => false)), 'password' => new sfValidatorString(array('required' => false))));
     $this->widgetSchema->setLabel('name', 'Database Name');
     $this->widgetSchema['password'] = new sfWidgetFormInputPassword();
     $this->widgetSchema['password_again'] = new sfWidgetFormInputPassword();
     $this->validatorSchema['password_again'] = clone $this->validatorSchema['password'];
     $this->widgetSchema->setNameFormat('database[%s]');
     $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
     $this->mergePostValidator(new sfValidatorSchemaCompare('password', sfValidatorSchemaCompare::EQUAL, 'password_again', array(), array('invalid' => 'The two passwords must be the same.')));
     parent::setup();
 }
開發者ID:sympal,項目名稱:sympal,代碼行數:14,代碼來源:sfSympalInstallForm.class.php

示例9: setup

 /**
  * Overridden to allow the app to add to the form and then to process
  * those additions and turn them into one giant, embedded form
  */
 public function setup()
 {
     // allow the application to add fields to the form
     self::$dispatcher->notify(new sfEvent($this, 'sympal.load_config_form'));
     $otherSettings = array();
     foreach ($this->_settings as $group => $settings) {
         if (!is_numeric($group)) {
             $form = new BaseForm();
             foreach ($settings as $setting) {
                 $form->setWidget($setting['name'], $setting['widget']);
                 $form->getWidgetSchema()->setLabel($setting['name'], $setting['label']);
                 $form->setValidator($setting['name'], $setting['validator']);
             }
             $this->embedForm($group, $form);
         } else {
             $otherSettings[] = $settings;
         }
     }
     foreach ($otherSettings as $setting) {
         $this->setWidget($setting['name'], $setting['widget']);
         $this->getWidgetSchema()->setLabel($setting['name'], $setting['label']);
         $this->setValidator($setting['name'], $setting['validator']);
     }
     $defaults = $this->getDefaults();
     foreach ($this as $key => $value) {
         if ($value instanceof sfFormFieldSchema) {
             foreach ($value as $k => $v) {
                 $defaults[$key][$k] = sfSympalConfig::get($key, $k);
             }
         } else {
             $defaults[$key] = sfSympalConfig::get($key);
         }
     }
     $this->setDefaults($defaults);
     $this->widgetSchema->setNameFormat('settings[%s]');
     $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
     parent::setup();
 }
開發者ID:sympal,項目名稱:sympal,代碼行數:42,代碼來源:sfSympalConfigForm.class.php

示例10: setup

 public function setup()
 {
     $this->setWidgets(array('email' => new sfWidgetFormInputText()));
     $this->setValidators(array('email' => new sfValidatorEmail()));
     parent::setup();
 }
開發者ID:robinkanters,項目名稱:dnsleergemeenschap,代碼行數:6,代碼來源:lostPasswordForm.class.php


注:本文中的BaseForm::setup方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。