当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Form_Element_Hidden::addValidators方法代码示例

本文整理汇总了PHP中Zend_Form_Element_Hidden::addValidators方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Element_Hidden::addValidators方法的具体用法?PHP Zend_Form_Element_Hidden::addValidators怎么用?PHP Zend_Form_Element_Hidden::addValidators使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Form_Element_Hidden的用法示例。


在下文中一共展示了Zend_Form_Element_Hidden::addValidators方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 /**
  * (non-PHPdoc)
  * @see Zend_Form#init()
  */
 public function init()
 {
     $table = new Tri_Db_Table('activity_text');
     $validators = $table->getValidators();
     $filters = $table->getFilters();
     $translate = Zend_Registry::get('Zend_Translate');
     $this->setAction('activity/text/save')->setMethod('post');
     $activityId = new Zend_Form_Element_Hidden('activity_id');
     $activityId->addValidators($validators['activity_id'])->addFilters($filters['activity_id'])->removeDecorator('Label')->removeDecorator('HtmlTag');
     $userId = new Zend_Form_Element_Hidden('user_id');
     $userId->addValidators($validators['user_id'])->addFilters($filters['user_id'])->removeDecorator('Label')->removeDecorator('HtmlTag');
     $description = new Zend_Form_Element_Textarea('description');
     $description->setLabel('Description')->addValidators($validators['description'])->addFilters($filters['description'])->setAttrib('rows', 20)->setAttrib('cols', '70%')->setAttrib('id', 'text-description-text')->setAllowEmpty(false);
     $status = new Zend_Form_Element_Hidden('status');
     $status->removeDecorator('Label')->removeDecorator('HtmlTag');
     $this->addElement($userId)->addElement($activityId)->addElement($status)->addElement($description);
     if (Zend_Auth::getInstance()->getIdentity()->role == 'student') {
         $saveDraft = new Zend_Form_Element_Submit('saveDraft');
         $sendCorrection = new Zend_Form_Element_Submit('sendCorrection');
         $saveDraft->removeDecorator('Label')->removeDecorator('DtDdWrapper');
         $sendCorrection->removeDecorator('Label')->removeDecorator('DtDdWrapper');
         $this->addElement($saveDraft)->addElement($sendCorrection);
     } else {
         $openButton = new Zend_Form_Element_Submit('openButton');
         $finalize = new Zend_Form_Element_Submit('finalize');
         $openButton->removeDecorator('Label')->removeDecorator('DtDdWrapper');
         $finalize->removeDecorator('Label')->removeDecorator('DtDdWrapper');
         $note = new Zend_Form_Element_Text('note');
         $note->setLabel('Note')->addValidator('Int')->addFilter('Digits');
         $this->addElement($note)->addElement($openButton)->addElement($finalize);
     }
 }
开发者ID:ramonornela,项目名称:trilhas,代码行数:36,代码来源:Text.php

示例2: init

 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('class', 'col-md-9');
     $decoratorField = new My_Decorator_Field();
     $elements = array();
     //render our form elements and the "form" tag
     $this->setDecorators(array('FormElements', 'Form'));
     $this->setElementDecorators(array('ViewHelper', 'Label'));
     // Add Quantity field
     $input = new Zend_Form_Element_Text('quantity', array('required' => true, 'class' => '"col-md-6"', 'min' => self::MIN, 'max' => self::MAX, 'step' => '1', 'type' => 'number'));
     $min = new Zend_Validate_LessThan(self::MAX + 1);
     $max = new Zend_Validate_GreaterThan(self::MIN);
     $input->addValidators(array(new Zend_Validate_Float(), $min, $max, new Zend_Validate_NotEmpty()));
     $input->addDecorator($decoratorField);
     $elements[] = $input;
     //Add id hidden field
     $input = new Zend_Form_Element_Hidden('product_id');
     $min = new Zend_Validate_GreaterThan(self::MIN);
     $input->addValidators(array(new Zend_Validate_Digits(), $min, new Zend_Validate_NotEmpty()));
     $input->removeDecorator('HtmlTag');
     $input->removeDecorator('Label');
     $elements[] = $input;
     $this->addElements($elements);
 }
开发者ID:cioionut,项目名称:products-webEcommerce,代码行数:25,代码来源:UpdateCart.php

示例3: init

 /**
  * (non-PHPdoc)
  * @see Zend_Form#init()
  */
 public function init()
 {
     $table = new Tri_Db_Table('activity');
     $validators = $table->getValidators();
     $filters = $table->getFilters();
     $statusOptions = $table->fetchPairs('status', 'status');
     $this->setAction('activity/index/save')->setMethod('post');
     $id = new Zend_Form_Element_Hidden('id');
     $id->addValidators($validators['id'])->addFilters($filters['id'])->removeDecorator('Label')->removeDecorator('HtmlTag');
     $filters['title'][] = 'StripTags';
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Title')->addValidators($validators['title'])->addFilters($filters['title']);
     $filters['description'][] = 'StripTags';
     $description = new Zend_Form_Element_Textarea('description');
     $description->setLabel('Description')->addValidators($validators['description'])->addFilters($filters['description'])->setAttrib('rows', 10)->setAllowEmpty(false);
     if (!$statusOptions || isset($statusOptions[''])) {
         $status = new Zend_Form_Element_Text('status');
     } else {
         $statusOptions = array_unique($statusOptions);
         $status = new Zend_Form_Element_Select('status');
         $status->addMultiOptions(array('' => '[select]') + $statusOptions)->setRegisterInArrayValidator(false);
     }
     $begin = new Zend_Form_Element_Text('begin');
     $begin->setLabel('Begin')->setAttrib('class', 'date')->addFilters($filters['begin'])->addValidators($validators['begin'])->setAllowEmpty(false)->getPluginLoader('filter')->addPrefixPath('Tri_Filter', 'Tri/Filter');
     $end = new Zend_Form_Element_Text('end');
     $end->setLabel('End')->setAttrib('class', 'date')->addFilters($filters['end'])->getPluginLoader('filter')->addPrefixPath('Tri_Filter', 'Tri/Filter');
     $status->setLabel('Status')->addValidators($validators['status'])->addFilters($filters['status']);
     $this->addElement($id)->addElement($title)->addElement($description)->addElement($begin)->addElement($end)->addElement($status)->addElement('submit', 'Save');
 }
开发者ID:ramonornela,项目名称:trilhas,代码行数:33,代码来源:Activity.php

示例4: init

 public function init()
 {
     $session = new Zend_Session_Namespace('data');
     $calendar = new Tri_Db_Table('calendar');
     $classroom = new Tri_Db_Table('classroom');
     $validators = $calendar->getValidators();
     $filters = $calendar->getFilters();
     $options = $classroom->fetchPairs('id', 'name', array('id IN(?)' => $session->classrooms));
     $this->setAction('calendar/index/save')->setMethod('post');
     $id = new Zend_Form_Element_Hidden('id');
     $id->addValidators($validators['id'])->addFilters($filters['id'])->removeDecorator('Label')->removeDecorator('HtmlTag');
     $classroom_id = new Zend_Form_Element_Select('classroom_id');
     $classroom_id->setLabel('Classroom')->addValidators($validators['classroom_id'])->addFilters($filters['classroom_id'])->addMultiOptions(array('' => '[select]') + $options);
     $description = new Zend_Form_Element_Textarea('description');
     $description->setLabel('Description')->addValidators($validators['description'])->addFilters($filters['description'])->setAllowEmpty(false)->setAttrib('rows', 7);
     $begin = new Zend_Form_Element_Text('begin');
     $begin->setLabel('Begin')->setAttrib('class', 'date')->addFilters($filters['begin'])->addValidators($validators['begin'])->setAllowEmpty(false)->getPluginLoader('filter')->addPrefixPath('Tri_Filter', 'Tri/Filter');
     $end = new Zend_Form_Element_Text('end');
     $end->setLabel('End')->setAttrib('class', 'date')->addFilters($filters['end'])->getPluginLoader('filter')->addPrefixPath('Tri_Filter', 'Tri/Filter');
     $this->addElement($id);
     $this->addElement($classroom_id);
     $this->addElement($description);
     $this->addElement($begin);
     $this->addElement($end);
     $this->addElement('submit', 'Save');
 }
开发者ID:ramonornela,项目名称:trilhas,代码行数:26,代码来源:Form.php

示例5: init

 /**
  * (non-PHPdoc)
  * @see Zend_Form#init()
  */
 public function init()
 {
     $this->addElementPrefixPath('Tri_Filter', 'Tri/Filter', 'FILTER');
     $table = new Tri_Db_Table('chat_room');
     $validators = $table->getValidators();
     $filters = $table->getFilters();
     $statusOptions = array('open' => 'open', 'close' => 'close');
     $this->setAction('chat/room/save')->setMethod('post')->setAttrib('enctype', 'multipart/form-data');
     $id = new Zend_Form_Element_Hidden('id');
     $id->addValidators($validators['id'])->addFilters($filters['id'])->removeDecorator('Label')->removeDecorator('HtmlTag');
     $filters['name'][] = 'StripTags';
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Title')->addValidators($validators['title'])->addFilters($filters['title']);
     $description = new Zend_Form_Element_Textarea('description');
     $description->setLabel('Description')->addValidators($validators['description'])->addFilters($filters['description'])->setAttrib('rows', 10);
     $max = new Zend_Form_Element_Text('max_student');
     $max->setLabel('Max student')->addValidators($validators['max_student'])->addFilters($filters['max_student']);
     if (!$statusOptions || isset($statusOptions[''])) {
         $status = new Zend_Form_Element_Text('status');
     } else {
         $statusOptions = array_unique($statusOptions);
         $status = new Zend_Form_Element_Select('status');
         $status->addMultiOptions(array('' => '[select]') + $statusOptions)->setRegisterInArrayValidator(false);
     }
     $status->setLabel('Status')->addValidators($validators['status'])->addFilters($filters['status']);
     $this->addElement($id)->addElement($title)->addElement($description)->addElement($status)->addElement('submit', 'Save');
 }
开发者ID:ramonornela,项目名称:trilhas,代码行数:31,代码来源:Room.php

示例6: init

 /**
  * (non-PHPdoc)
  * @see Zend_Form#init()
  */
 public function init()
 {
     $this->addElementPrefixPath('Tri_Filter', 'Tri/Filter', 'FILTER');
     $table = new Tri_Db_Table('classroom');
     $course = new Tri_Db_Table('course');
     $user = new Tri_Db_Table('user');
     $validators = $table->getValidators();
     $filters = $table->getFilters();
     $where = array("role = 'institution' OR role = 'Teacher' OR role = 'Creator'");
     $users = $user->fetchPairs('id', 'name', $where, 'name');
     $statusOptions = array('active' => 'active', 'inactive' => 'inactive', 'open' => 'open');
     $courses = $course->fetchPairs('id', 'name', "status = 'active'");
     $this->setAction('admin/classroom/save')->setMethod('post')->setAttrib('enctype', 'multipart/form-data');
     $id = new Zend_Form_Element_Hidden('id');
     $id->addValidators($validators['id'])->addFilters($filters['id'])->removeDecorator('Label')->removeDecorator('HtmlTag');
     $courseId = new Zend_Form_Element_Select('course_id');
     $courseId->setLabel('Course')->addValidators($validators['course_id'])->addFilters($filters['course_id'])->addMultiOptions(array('' => '[select]') + $courses);
     $filters['name'][] = 'StripTags';
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('Name')->addValidators($validators['name'])->addFilters($filters['name']);
     $responsible = new Zend_Form_Element_Select('responsible');
     $responsible->setLabel('Responsible')->addValidators($validators['responsible'])->addFilters($filters['responsible'])->addMultiOptions(array('' => '[select]') + $users);
     $begin = new Zend_Form_Element_Text('begin');
     $begin->setLabel('Begin')->setAttrib('class', 'date')->addFilters($filters['begin'])->addValidators($validators['begin'])->setAllowEmpty(false);
     $end = new Zend_Form_Element_Text('end');
     $end->setLabel('End')->setAttrib('class', 'date')->addFilters($filters['end']);
     $max = new Zend_Form_Element_Text('max_student');
     $max->setLabel('Max student')->addValidators($validators['max_student'])->addFilters($filters['max_student']);
     $amount = new Zend_Form_Element_Text('amount');
     $amount->setLabel('Amount')->addValidators($validators['amount'])->addFilters($filters['amount']);
     $status = new Zend_Form_Element_Select('status');
     $status->addMultiOptions($statusOptions)->setRegisterInArrayValidator(false)->setLabel('Status')->addValidators($validators['status'])->addFilters($filters['status']);
     $this->addElement($id)->addElement($courseId)->addElement($name)->addElement($responsible)->addElement($begin)->addElement($end)->addElement($max)->addElement($amount)->addElement($status)->addElement('submit', 'Save');
 }
开发者ID:ramonornela,项目名称:trilhas,代码行数:38,代码来源:Classroom.php

示例7: init

 /**
  * (non-PHPdoc)
  * @see Zend_Form#init()
  */
 public function init()
 {
     $this->addElementPrefixPath('Tri_Filter', 'Tri/Filter', 'FILTER');
     $this->addElementPrefixPath('Tri_Validate', 'Tri/Validate', 'VALIDATE');
     $user = new Tri_Db_Table('user');
     $validators = $user->getValidators();
     $filters = $user->getFilters();
     $statusOptions = $user->fetchPairs('status', 'status');
     $roles = $user->fetchPairs('role', 'role');
     $uploadDir = str_replace('APPLICATION_PATH', APPLICATION_PATH, Tri_Config::get('tri_upload_dir'));
     $this->setAction('user/save')->setMethod('post')->setAttrib('enctype', 'multipart/form-data');
     $id = new Zend_Form_Element_Hidden('id');
     $id->addValidators($validators['id'])->addFilters($filters['id'])->removeDecorator('Label')->removeDecorator('HtmlTag');
     $filters['name'][] = 'StripTags';
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('Name')->addValidators($validators['name'])->addFilters($filters['name'])->setAllowEmpty(false);
     $email = new Zend_Form_Element_Text('email');
     $email->setLabel('Email')->addValidators($validators['email'])->addFilters($filters['email'])->setAllowEmpty(false);
     $filters['password'][] = 'Md5';
     $validators['password'][] = 'PasswordConfirmation';
     $password = new Zend_Form_Element_Password('password');
     $password->setLabel('Password')->addValidators($validators['password'])->addFilters($filters['password']);
     $passwordConfirmation = new Zend_Form_Element_Password('password_confirm');
     $passwordConfirmation->setLabel('Password confirmation')->addFilter('Md5');
     $sex = new Zend_Form_Element_Select('sex');
     $sex->setLabel('Sex')->addValidators($validators['sex'])->addFilters($filters['sex'])->addMultiOptions(array('' => '[select]', 'M' => 'Male', 'F' => 'Female'));
     $born = new Zend_Form_Element_Text('born');
     $born->setLabel('Born')->setAttrib('class', 'date')->addFilters($filters['born'])->addValidators($validators['born']);
     $filters['description'][] = 'StripTags';
     $description = new Zend_Form_Element_Textarea('description');
     $description->setLabel('Description')->addValidators($validators['description'])->addFilters($filters['description'])->setAllowEmpty(false);
     $file = new Zend_Form_Element_File('image');
     $file->setLabel('Image')->setDestination($uploadDir)->setMaxFileSize(2097152)->setValueDisabled(true)->addFilter('Rename', uniqid())->addValidator('Count', false, 1)->addValidator('Size', false, 2097152)->addValidator('Extension', false, 'jpg,png,gif');
     if (!$roles || isset($roles[''])) {
         $role = new Zend_Form_Element_Text('role');
     } else {
         $rolea = array_unique($roles);
         $role = new Zend_Form_Element_Select('role');
         $role->addMultiOptions(array('' => '[select]') + $roles)->setRegisterInArrayValidator(false);
     }
     $role->setLabel('Role')->addValidators($validators['role'])->addFilters($filters['role']);
     if (!$statusOptions || isset($statusOptions[''])) {
         $status = new Zend_Form_Element_Text('status');
     } else {
         $statusOptions = array_unique($statusOptions);
         $status = new Zend_Form_Element_Select('status');
         $status->addMultiOptions(array('' => '[select]') + $statusOptions)->setRegisterInArrayValidator(false);
     }
     $status->setLabel('Status')->addValidators($validators['status'])->addFilters($filters['status']);
     $this->addElement($id)->addElement($name)->addElement($email)->addElement($password)->addElement($passwordConfirmation)->addElement($description)->addElement($sex)->addElement($born)->addElement($file);
     $identity = Zend_Auth::getInstance()->getIdentity();
     if ($identity && $identity->role == 'institution') {
         $this->addElement($status)->addElement($role);
     }
     $this->addElement('submit', 'Save');
 }
开发者ID:ramonornela,项目名称:trilhas,代码行数:60,代码来源:User.php

示例8: init

 /**
  * (non-PHPdoc)
  * @see Zend_Form#init()
  */
 public function init()
 {
     $table = new Tri_Db_Table('exercise_question');
     $validators = $table->getValidators();
     $filters = $table->getFilters();
     $this->setAction('exercise/question/save')->setMethod('post');
     $id = new Zend_Form_Element_Hidden('id');
     $id->addValidators($validators['id'])->addFilters($filters['id'])->removeDecorator('Label')->removeDecorator('HtmlTag');
     $filters['description'][] = 'StripTags';
     $description = new Zend_Form_Element_Textarea('description');
     $description->setLabel('Description')->addValidators($validators['description'])->addFilters($filters['description'])->setAttrib('rows', 10)->setAllowEmpty(false);
     $this->addElement($id)->addElement($description);
 }
开发者ID:ramonornela,项目名称:trilhas,代码行数:17,代码来源:Question.php

示例9: init

 /**
  * (non-PHPdoc)
  * @see Zend_Form#init()
  */
 public function init()
 {
     $table = new Tri_Db_Table('message');
     $validators = $table->getValidators();
     $filters = $table->getFilters();
     $this->setAction('chat/message/save')->setMethod('post');
     $id = new Zend_Form_Element_Hidden('id');
     $id->addValidators($validators['id'])->addFilters($filters['id'])->removeDecorator('Label')->removeDecorator('HtmlTag');
     $receiver = new Zend_Form_Element_Hidden('receiver');
     $receiver->addValidators($validators['receiver'])->addFilters($filters['receiver'])->removeDecorator('Label')->removeDecorator('HtmlTag');
     $description = new Zend_Form_Element_Textarea('description');
     $description->setLabel('Description')->addValidators($validators['description'])->addFilters($filters['description'])->setAttrib('rows', 10)->setAllowEmpty(false);
     $this->addElement($id)->addElement($receiver)->addElement($description)->addElement('submit', 'Save');
 }
开发者ID:ramonornela,项目名称:trilhas,代码行数:18,代码来源:Message.php

示例10: init

 /**
  * (non-PHPdoc)
  * @see Zend_Form#init()
  */
 public function init()
 {
     $table = new Tri_Db_Table('content_template');
     $validators = $table->getValidators();
     $filters = $table->getFilters();
     $this->setAction('content/template/save')->setMethod('post');
     $id = new Zend_Form_Element_Hidden('id');
     $id->addValidators($validators['id'])->addFilters($filters['id'])->removeDecorator('Label')->removeDecorator('HtmlTag');
     $filters['name'][] = 'StripTags';
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('Name')->addValidators($validators['name'])->addFilters($filters['name']);
     $description = new Zend_Form_Element_Textarea('description');
     $description->setLabel('Description')->addValidators($validators['description'])->addFilters($filters['description'])->setAttrib('rows', 15)->setAttrib('id', 'template-description-text')->setAllowEmpty(false);
     $this->addElement($id)->addElement($name)->addElement($description)->addElement('submit', 'Save');
 }
开发者ID:ramonornela,项目名称:trilhas,代码行数:19,代码来源:Template.php

示例11: init

 /**
  * (non-PHPdoc)
  * @see Zend_Form#init()
  */
 public function init()
 {
     $table = new Tri_Db_Table('forum_reply');
     $validators = $table->getValidators();
     $filters = $table->getFilters();
     $this->setAction('forum/reply/save')->setMethod('post');
     $id = new Zend_Form_Element_Hidden('id');
     $id->addValidators($validators['id'])->addFilters($filters['id'])->removeDecorator('Label')->removeDecorator('HtmlTag');
     $forumId = new Zend_Form_Element_Hidden('forum_id');
     $forumId->addValidators($validators['forum_id'])->addFilters($filters['forum_id'])->removeDecorator('Label')->removeDecorator('HtmlTag');
     $filters['description'][] = 'StripTags';
     $description = new Zend_Form_Element_Textarea('description');
     $description->setLabel('Description')->addValidators($validators['description'])->addFilters($filters['description'])->setAttrib('rows', 6)->setAttrib('cols', 60)->setAllowEmpty(false);
     $this->addElement($id)->addElement($forumId)->addElement($description)->addElement('submit', 'Save');
 }
开发者ID:ramonornela,项目名称:trilhas,代码行数:19,代码来源:Reply.php

示例12: init

 /**
  * (non-PHPdoc)
  * @see Zend_Form#init()
  */
 public function init()
 {
     $table = new Tri_Db_Table('glossary');
     $validators = $table->getValidators();
     $filters = $table->getFilters();
     $this->setAction('glossary/index/save')->setMethod('post');
     $id = new Zend_Form_Element_Hidden('id');
     $id->addValidators($validators['id'])->addFilters($filters['id'])->removeDecorator('Label')->removeDecorator('HtmlTag');
     $filters['word'][] = 'StripTags';
     $word = new Zend_Form_Element_Text('word');
     $word->setLabel('Word')->addValidators($validators['word'])->addFilters($filters['word']);
     $description = new Zend_Form_Element_Textarea('description');
     $description->setLabel('Description')->addValidators($validators['description'])->addFilters($filters['description'])->setAttrib('rows', 15)->setAllowEmpty(false);
     $this->addElement($id)->addElement($word)->addElement($description)->addElement('submit', 'Save');
 }
开发者ID:ramonornela,项目名称:trilhas,代码行数:19,代码来源:Glossary.php

示例13: init

 /**
  * (non-PHPdoc)
  * @see Zend_Form#init()
  */
 public function init()
 {
     $table = new Tri_Db_Table('faq');
     $validators = $table->getValidators();
     $filters = $table->getFilters();
     $this->setAction('faq/index/save')->setMethod('post');
     $id = new Zend_Form_Element_Hidden('id');
     $id->addValidators($validators['id'])->addFilters($filters['id'])->removeDecorator('Label')->removeDecorator('HtmlTag');
     $filters['question'][] = 'StripTags';
     $question = new Zend_Form_Element_Textarea('question');
     $question->setLabel('Question')->addValidators($validators['question'])->addFilters($filters['question'])->setAttrib('rows', 10)->setAllowEmpty(false);
     $filters['answer'][] = 'StripTags';
     $answer = new Zend_Form_Element_Textarea('answer');
     $answer->setLabel('Answer')->addValidators($validators['answer'])->addFilters($filters['answer'])->setAttrib('rows', 15)->setAllowEmpty(false);
     $this->addElement($id)->addElement($question)->addElement($answer)->addElement('submit', 'Save');
 }
开发者ID:ramonornela,项目名称:trilhas,代码行数:20,代码来源:Faq.php

示例14: init

 public function init()
 {
     $this->setMethod('post');
     $decoratorField = new My_Decorator_Field();
     $elements = array();
     //Add id hidden field
     $input = new Zend_Form_Element_Hidden('product_id');
     $min = new Zend_Validate_GreaterThan(self::MIN);
     $input->addValidators(array(new Zend_Validate_Digits(), $min, new Zend_Validate_NotEmpty()));
     $elements[] = $input;
     //Add Submit button
     $input = new Zend_Form_Element_Submit('submit', array('Label' => '', 'class' => 'btn btn-danger', 'value' => 'Delete'));
     $elements[] = $input;
     $input->addDecorator($decoratorField);
     $this->addElements($elements);
 }
开发者ID:cioionut,项目名称:products-webEcommerce,代码行数:16,代码来源:DeleteProduct.php

示例15: init

 public function init()
 {
     $this->setMethod('post');
     $decoratorField = new My_Decorator_Field();
     $elements = array();
     //render our form elements and the "form" tag
     $this->setDecorators(array('FormElements', 'Form'));
     $this->setElementDecorators(array('ViewHelper', 'Label'));
     //Add id hidden field
     $input = new Zend_Form_Element_Hidden('product_id');
     $min = new Zend_Validate_GreaterThan(self::MIN);
     $input->addValidators(array(new Zend_Validate_Digits(), $min, new Zend_Validate_NotEmpty()));
     $input->removeDecorator('HtmlTag');
     $input->removeDecorator('Label');
     $elements[] = $input;
     $this->addElements($elements);
 }
开发者ID:cioionut,项目名称:products-webEcommerce,代码行数:17,代码来源:DelFromCart.php


注:本文中的Zend_Form_Element_Hidden::addValidators方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。