Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

無題
2008年 4月 6日 日曜日 03:14:51 MDT 

  1. <?php
  2.  
  3. class My_Forms_RegisterForm extends Zend_Form {
  4.        
  5.         public function __construct($options = null) {
  6.                
  7.                 parent::__construct($options);
  8.                
  9.                 //$this->addPrefixPath('My_Forms', 'My/Forms/');
  10.                 //$this->addElementPrefixPath('My_Forms', 'My/Forms');
  11.                 //$this->addPrefixPath('My_Validate', 'My/Validate/', 'validate');
  12.  
  13.                 $this->addElement('text', 'nimi', array(
  14.                         'label'                 => 'Nimi:',
  15.                         'description'   => 'Nimi peab olema 2-16 pikk ja A-Z a-z 0-9',
  16.                         'validators'    => array(
  17.                                 'alnum',
  18.                                 array('StringLength', false, array(2, 16))
  19.                         ),
  20.                         'required'            => true,
  21.                         'filters'             => array('StringTrim'),
  22.                         'decorators'    => array(
  23.                                 array('ViewHelper'),
  24.                                 array('Errors'),
  25.                                 array('HtmlTag', array('tag' => 'dd')),
  26.                                 array('Label', array('tag' => 'dt')),
  27.                                 array('Description', array('tag' => 'p'))
  28.                         )
  29.                 ));
  30.                
  31.  
  32.                 $this->addElement('password', 'parool', array(
  33.                         'label'   => 'Parool:',
  34.                         'description'   => 'Parool peab olema 5-16 pikk ning koosnema numbritest ja tähtedest',
  35.                         'validators'    => array(
  36.                                 'alnum',
  37.                                 array('StringLength', false, array(5, 16)),
  38.                         ),
  39.                         'required'            => true,
  40.                         'decorators'    => array(
  41.                                 array('ViewHelper'),
  42.                                 array('Errors'),
  43.                                 array('HtmlTag', array('tag' => 'dd')),
  44.                                 array('Label', array('tag' => 'dt')),
  45.                                 array('Description', array('tag' => 'p'))
  46.                         )
  47.                 ));          
  48.                
  49.                 $this->addElement('password', 'parool2', array(
  50.                         'label'   => 'Parool veelkord:',
  51.                         'description'   => 'Sisesta parool veelkord',
  52.                         'validators'    => array(
  53.                                 array(new My_Validate_Password('parool'))
  54.                         ),
  55.                         'required'            => true,
  56.                         'decorators'    => array(
  57.                                 array('ViewHelper'),
  58.                                 array('Errors'),
  59.                                 array('HtmlTag', array('tag' => 'dd')),
  60.                                 array('Label', array('tag' => 'dt')),
  61.                                 array('Description', array('tag' => 'p'))
  62.                         )
  63.                 ));
  64.                
  65.                 $this->addElement('text', 'email', array(
  66.                         'label'   => 'E-mail:',
  67.                         'description'   => 'Siia e-mailile saadetakse aktiveermis kood',
  68.                         'validators'    => array(
  69.                                 'EmailAddress'
  70.                         ),
  71.                         'required'            => true,
  72.                         'decorators'    => array(
  73.                                 array('ViewHelper'),
  74.                                 array('Errors'),
  75.                                 array('HtmlTag', array('tag' => 'dd')),
  76.                                 array('Label', array('tag' => 'dt')),
  77.                                 array('Description', array('tag' => 'p'))
  78.                         )
  79.                 ));
  80.                
  81.                 $this->addElement('text', 'securecode', array(
  82.                         'label'   => 'Kontroll kood:',
  83.                         'description'   => 'Sisesta pildil olev kood',
  84.                         'validators'    => array(
  85.                                 array('NotEmpty', true, array(
  86.                                         'messages' => array('isEmpty' => 'Kontroll kood jäi sisestamata!')     
  87.                                 )),
  88.                                 array('Alnum', false, array(
  89.                                         'messages' => array('notAlnum' => 'Ei ole kõik ainult tähed ja numbrid!')     
  90.                                 )),
  91.                         ),
  92.                         'decorators'    => array(
  93.                                 array('ViewHelper'),
  94.                                 array('Errors'),
  95.                                 array('HtmlTag', array('tag' => 'dd')),
  96.                                 array('Label', array('tag' => 'dt')),
  97.                                 array('Description', array('tag' => 'p'))
  98.                         )
  99.                 ));          
  100.                
  101.                 $this->setElementFilters(array('StringTrim', 'StripTags'));
  102.                 $this->addElement('submit', 'Register');
  103.                
  104.                 //return $this;
  105.         }
  106. }
  107.  
  108. ?>

advertising

ポストを更新

このポストは更新できる、または、新しいポストを作成

You may also comment on this post.

ペーストの更新
ポストの詳細 (随意)

注目: ペーストのコンテントだけで必要ですが、以下の情報は便利かも知れません。

名前/タイトルを保存する?

(スペースで切る, 随意)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

fantasy-obligation