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


PHP Zend_Form_Element_Text::addPrefixPath方法代碼示例

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


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

示例1: init

 public function init()
 {
     $schemeSelect = new Zend_Form_Element_Select(array('name' => 'schemeSelect', 'required' => TRUE, 'belongsTo' => $this->getName(), 'style' => 'width:80px;margin-right:2px;padding:2px 0;', 'multiOptions' => array('http://' => 'http://', 'https://' => 'https://')));
     $this->setSchemeSelect($schemeSelect);
     $hostText = new Zend_Form_Element_Text(array('name' => 'hostText', 'belongsTo' => $this->getName(), 'class' => 'form-control', 'placeholder' => Zend_Registry::get('Zend_Translate')->_('adres URL'), 'validators' => array(array('stringLength', true, array('min' => 5, 'max' => 185)), array(new My_Validate_UrlHost(), true)), 'filters' => array(array('strReplace', array(array('search' => array('http://', 'https://'), 'replace' => ''))), array('stringTrim', array('/')))));
     $hostText->addPrefixPath('My_Filter', 'My/Filter/', 'filter');
     $this->setHostText($hostText);
 }
開發者ID:komik966,項目名稱:recruitment,代碼行數:8,代碼來源:Url.php

示例2: init

 public function init()
 {
     /* $email = $this->addElement('text', 'email', array(
        'filters'    => array('StringTrim', 'StringToLower'),
        'validators' => array(
        'EmailAddress',
        ),
        'required'   => true,
        'label'      => $this->translate->_("Email"),
        'decorators' => $this->elementDecorators,
        'description'=>"mustbe lower..."
        )); */
     $email = new Zend_Form_Element_Text("email");
     $email->setLabel('Email');
     $email->setDecorators($this->elementDecorators);
     $email->addValidator("EmailAddress");
     $email->addValidator("ExistUser", false, array("email"));
     $email->addPrefixPath('VC_Validate', 'VC/Validate/', 'validate');
     $this->addElements(array($email));
     /*$username = $this->addElement('text', 'username', array(
           'filters' => array('StringTrim', 'StringToLower'),
           'validators' => array(
               'Alpha',
               array('StringLength', false, array(3, 20)),
           ),
           'required' => true,
           'label' => $this->translate->_("Username"),
           'decorators' => $this->elementDecorators,
       ));
       */
     $token = $this->addElement('hidden', 'token', array('disableLoadDefaultDecorators' => true));
     $password = $this->addElement('password', 'password', array('filters' => array('StringTrim'), 'validators' => array(array('StringLength', false, array(6, 20))), 'required' => true, 'label' => $this->translate->_("Password"), 'decorators' => $this->elementDecorators));
     /* $re_password = $this->addElement('password', 'password_confirm', array(
        'filters'    => array('StringTrim'),
        'validators' => array(
        array('SL_ValidatorMatch', false, array("password")),
        ),
        'required'   => true,
        'label'      => $this->translate->_("Confirm password"),
        'decorators' => $this->elementDecorators,
        )); */
     $re_password = new Zend_Form_Element_Password("password_confirm");
     $re_password->setLabel('Confirm Password');
     $re_password->setDecorators($this->elementDecorators);
     $re_password->addValidator("PasswordConfirmation", false, array("password"));
     $re_password->addPrefixPath('VC_Validate', 'VC/Validate/', 'validate');
     $this->addElements(array($re_password));
     $username = $this->addElement('text', 'fullname', array('filters' => array('StringTrim'), 'validators' => array(array('StringLength', false, array(3, 70))), 'required' => true, 'label' => $this->translate->_("Full name"), 'decorators' => $this->elementDecorators));
     // Add a captcha
     $this->addElement('captcha', 'captcha', array('label' => $this->translate->_("Please enter the 5 letters displayed below:"), 'required' => true, 'captcha' => array('captcha' => 'Figlet', 'wordLen' => 5, 'timeout' => 300)));
     $login = $this->addElement('submit', 'login', array('required' => false, 'ignore' => true, 'label' => $this->translate->_("Register"), 'decorators' => $this->buttonDecorators));
 }
開發者ID:BGCX261,項目名稱:zillatek-project-svn-to-git,代碼行數:52,代碼來源:Register.php


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