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


PHP Zend_Filter_Input::getMessages方法代码示例

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


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

示例1: _prepareSave

 /**
  * Preapares data for saving of subscriber
  * Add the line for rapidmail status
  *
  * @param  Mage_Newsletter_Model_Subscriber $subscriber
  * @return array
  */
 protected function _prepareSave(Mage_Newsletter_Model_Subscriber $subscriber)
 {
     $data = array();
     $data['customer_id'] = $subscriber->getCustomerId();
     $data['store_id'] = $subscriber->getStoreId() ? $subscriber->getStoreId() : 0;
     $data['subscriber_status'] = $subscriber->getStatus();
     $data['subscriber_email'] = $subscriber->getEmail();
     $data['subscriber_confirm_code'] = $subscriber->getCode();
     $data['rapidmail_status'] = $subscriber->getRapidmailStatus();
     if ($subscriber->getIsStatusChanged()) {
         $data['change_status_at'] = Mage::getSingleton('core/date')->gmtDate();
     }
     $validators = array('subscriber_email' => 'EmailAddress');
     $filters = array();
     $input = new Zend_Filter_Input($filters, $validators, $data);
     $session = Mage::getSingleton($this->_messagesScope);
     if ($input->hasInvalid() || $input->hasMissing()) {
         foreach ($input->getMessages() as $message) {
             if (is_array($message)) {
                 foreach ($message as $error) {
                     $session->addError($error);
                 }
             } else {
                 $session->addError($message);
             }
         }
         Mage::throwException(Mage::helper('newsletter')->__('Form was filled incorrectly'));
     }
     return $data;
 }
开发者ID:narf-studios,项目名称:magento-rapidmail,代码行数:37,代码来源:Subscriber.php

示例2: searchAction

 public function searchAction()
 {
     $filters = array('q' => array('StringTrim', 'StripTags'));
     $validators = array('q' => array('presence' => 'required'));
     $input = new Zend_Filter_Input($filters, $validators, $_GET);
     if (is_string($this->_request->getParam('q'))) {
         $queryString = $input->getEscaped('q');
         $this->view->queryString = $queryString;
         if ($input->isValid()) {
             $config = Zend_Registry::get('config');
             $index = App_Search_Lucene::open($config->luceneIndex);
             $query = new Zend_Search_Lucene_Search_Query_Boolean();
             $pathTerm = new Zend_Search_Lucene_Index_Term($queryString);
             $pathQuery = new Zend_Search_Lucene_Search_Query_Term($pathTerm);
             $query->addSubquery($pathQuery, true);
             $pathTerm = new Zend_Search_Lucene_Index_Term('20091023', 'CreationDate');
             $pathQuery = new Zend_Search_Lucene_Search_Query_Term($pathTerm);
             $query->addSubquery($pathQuery, true);
             try {
                 $hits = $index->find($query);
             } catch (Zend_Search_Lucene_Exception $ex) {
                 $hits = array();
             }
             $this->view->hits = $hits;
         } else {
             $this->view->messages = $input->getMessages();
         }
     }
 }
开发者ID:philipnorton42,项目名称:PDFSearch,代码行数:29,代码来源:IndexController.php

示例3: contactUsAction

 public function contactUsAction()
 {
     $filters = array('name' => 'StringTrim', 'tel' => 'StringTrim', 'email' => 'StringTrim', 'enquiry' => 'StringTrim');
     $validators = array('name' => 'NotEmpty', 'tel' => 'NotEmpty', 'email' => 'NotEmpty', 'enquiry' => 'NotEmpty');
     $input = new Zend_Filter_Input($filters, $validators, $_POST);
     $returnArray = array();
     if ($input->isValid()) {
         $emailer = new Application_Core_Mail();
         $params = Zend_Registry::get('params');
         $emailer->setTo($params->email->contactUs, 'HomeLet');
         $emailer->setFrom($input->email, $input->name);
         $emailer->setSubject('HomeLet - Contact Us Form');
         $bodyHtml = 'Name : ' . $input->name . '<br />';
         $bodyHtml .= 'Email : ' . $input->email . '<br />';
         $bodyHtml .= 'Tel : ' . $input->tel . '<br />';
         $bodyHtml .= 'Enquiry : <pre>' . $input->enquiry . '</pre><br />';
         $emailer->setBodyHtml($bodyHtml);
         if ($emailer->send()) {
             // Email sent successfully
             $returnArray['success'] = true;
             $returnArray['errorMessage'] = '';
         } else {
             $returnArray['success'] = false;
             $returnArray['errorMessage'] = 'Problem sending email.';
         }
     } else {
         $returnArray['success'] = false;
         $returnArray['errorMessage'] = $input->getMessages();
     }
     echo Zend_Json::encode($returnArray);
 }
开发者ID:AlexEvesDeveloper,项目名称:hl-stuff,代码行数:31,代码来源:IndexController.php

示例4: _filterInputBlock

 protected function _filterInputBlock($params)
 {
     $input = new Zend_Filter_Input(array('*' => array('StripTags', 'StringTrim'), 'value' => array(array('Alnum', array('allowwhitespace' => true))), 'long_description' => array(), 'conclusion_text' => array(array('Alnum', array('allowwhitespace' => true)))), array('questionnaire_id' => array('NotEmpty'), 'designation' => array('allowEmpty' => true), 'value' => array('NotEmpty', 'messages' => array('O nome do bloco não pode ser vazio.')), 'long_description' => array('allowEmpty' => true), 'conclusion_text' => array('allowEmpty' => true)), $params, array('presence' => 'required'));
     if ($input->hasInvalid() || $input->hasMissing()) {
         throw new Vtx_UserException(Model_ErrorMessage::getFirstMessage($input->getMessages()));
     }
     return $input;
 }
开发者ID:Lazaro-Gallo,项目名称:psmn,代码行数:8,代码来源:Block.php

示例5: _filterInputQuestion

 protected function _filterInputQuestion($params)
 {
     $input = new Zend_Filter_Input(array('*' => array('StripTags', 'StringTrim'), 'term' => array(array('Alnum', array('allowwhitespace' => true))), 'description' => array(array('HtmlEntities'))), array('term' => array('NotEmpty'), 'description' => array('NotEmpty')), $params, array('presence' => 'required'));
     if ($input->hasInvalid() || $input->hasMissing()) {
         throw new Vtx_UserException(Model_ErrorMessage::getFirstMessage($input->getMessages()));
     }
     return $input;
 }
开发者ID:Lazaro-Gallo,项目名称:psmn,代码行数:8,代码来源:Glossary.php

示例6: _filterInputConfiguration

 protected function _filterInputConfiguration($params)
 {
     $input = new Zend_Filter_Input(array('*' => array('StripTags', 'StringTrim')), array(), $params, array('presence' => 'required'));
     if ($input->hasInvalid() || $input->hasMissing()) {
         throw new Vtx_UserException(Model_ErrorMessage::getFirstMessage($input->getMessages()));
     }
     return $input;
 }
开发者ID:Lazaro-Gallo,项目名称:psmn,代码行数:8,代码来源:Configuration.php

示例7: _filterInputECAC

 protected function _filterInputECAC($params)
 {
     $input = new Zend_Filter_Input(array('*' => array('StripTags', 'StringTrim')), array('enterprise_id' => array('NotEmpty', 'messages' => array('Erro ao cadastrar empresa'), 'presence' => 'required'), 'competition_id' => array('NotEmpty', 'messages' => array('Erro ao cadastrar empresa'), 'presence' => 'required'), 'category_award_id' => array('NotEmpty', 'messages' => array('Escolha a categoria do premio'), 'presence' => 'required'), 'token' => array('allowEmpty' => true)), $params);
     if ($input->hasInvalid() || $input->hasMissing()) {
         throw new Vtx_UserException(Model_ErrorMessage::getFirstMessage($input->getMessages()));
     }
     return $input;
 }
开发者ID:Lazaro-Gallo,项目名称:psmn,代码行数:8,代码来源:EnterpriseCategoryAwardCompetition.php

示例8: _filterInputAnswerFeedbackImprove

 protected function _filterInputAnswerFeedbackImprove($params)
 {
     $input = new Zend_Filter_Input(array('*' => array('StripTags', 'StringTrim')), array('user_id' => array('NotEmpty'), 'answer_id' => array('NotEmpty'), 'feedback_improve' => array('NotEmpty')), $params, array('presence' => 'required'));
     if ($input->hasInvalid() || $input->hasMissing()) {
         throw new Vtx_UserException(Model_ErrorMessage::getFirstMessage($input->getMessages()));
     }
     return $input;
 }
开发者ID:Lazaro-Gallo,项目名称:psmn,代码行数:8,代码来源:AnswerFeedbackImprove.php

示例9: _filterInputLogCadastroEmpresa

 protected function _filterInputLogCadastroEmpresa($params)
 {
     $input = new Zend_Filter_Input(array(), array('user_id_log' => array('NotEmpty', 'presence' => 'required'), 'enterprise_id' => array('NotEmpty', 'messages' => array('Erro ao cadastrar empresa.'), 'presence' => 'required'), 'programa_id' => array('NotEmpty', 'messages' => array('Erro ao cadastrar empresa.'), 'presence' => 'required'), 'acao' => array('NotEmpty', 'messages' => array('Erro ao cadastrar empresa.'), 'presence' => 'required')), $params, array());
     if ($input->hasInvalid() || $input->hasMissing()) {
         throw new Vtx_UserException(Model_ErrorMessage::getFirstMessage($input->getMessages()));
     }
     return $input;
 }
开发者ID:Lazaro-Gallo,项目名称:psmn,代码行数:8,代码来源:LogCadastroEmpresa.php

示例10: _filterInputServiceArea

 protected function _filterInputServiceArea($params)
 {
     $input = new Zend_Filter_Input(array(), array('regional_id' => array('NotEmpty', 'presence' => 'required'), 'StateId' => array('allowEmpty' => true), 'CityId' => array('allowEmpty' => true), 'NeighborhoodId' => array('allowEmpty' => true)), $params);
     if ($input->hasInvalid() || $input->hasMissing()) {
         throw new Vtx_UserException(Model_ErrorMessage::getFirstMessage($input->getMessages()));
     }
     return $input;
 }
开发者ID:Lazaro-Gallo,项目名称:psmn,代码行数:8,代码来源:ServiceArea.php

示例11: _filterInputEnterpriseProgramaRank

 protected function _filterInputEnterpriseProgramaRank($params)
 {
     $input = new Zend_Filter_Input(array('*' => array('StripTags', 'StringTrim')), array('enterprise_id_key' => array('allowEmpty' => true), 'user_id' => array('allowEmpty' => true), 'programa_id' => array('allowEmpty' => true), 'classificar' => array('allowEmpty' => true), 'desclassificar' => array('allowEmpty' => true), 'justificativa' => array('allowEmpty' => true), 'classificado_verificacao' => array('allowEmpty' => true), 'desclassificado_verificacao' => array('allowEmpty' => true), 'motivo_desclassificado_verificacao' => array('allowEmpty' => true), 'classificado_ouro' => array('allowEmpty' => true), 'classificado_prata' => array('allowEmpty' => true), 'classificado_bronze' => array('allowEmpty' => true), 'desclassificado_final' => array('allowEmpty' => true), 'motivo_desclassificado_final' => array('allowEmpty' => true), 'classificar_nacional' => array('allowEmpty' => true), 'desclassificar_nacional' => array('allowEmpty' => true), 'motivo_desclassificado_nacional' => array('allowEmpty' => true), 'classificar_fase2_nacional' => array('allowEmpty' => true), 'desclassificar_fase2_nacional' => array('allowEmpty' => true), 'motivo_desclassificado_fase2_nacional' => array('allowEmpty' => true), 'classificado_ouro_nacional' => array('allowEmpty' => true), 'classificado_prata_nacional' => array('allowEmpty' => true), 'classificado_bronze_nacional' => array('allowEmpty' => true), 'classificar_fase3_nacional' => array('allowEmpty' => true), 'desclassificar_fase3_nacional' => array('allowEmpty' => true), 'motivo_desclassificado_fase3_nacional' => array('allowEmpty' => true)), $params);
     if ($input->hasInvalid() || $input->hasMissing()) {
         throw new Vtx_UserException(Model_ErrorMessage::getFirstMessage($input->getMessages()));
     }
     return $input;
 }
开发者ID:Lazaro-Gallo,项目名称:psmn,代码行数:8,代码来源:EnterpriseProgramaRank.php

示例12: _filterInputAnnualResultData

 protected function _filterInputAnnualResultData($params)
 {
     $input = new Zend_Filter_Input(array('*' => array('StripTags', 'StringTrim'), 'value' => array(array('Alnum', array('allowwhitespace' => true))), 'Year' => array(array('Digits', array('allowwhitespace' => true)))), array('annual_result_id' => array('NotEmpty'), 'year' => array('allowEmpty' => true), 'value' => array('allowEmpty' => true)), $params, array('presence' => 'required'));
     if ($input->hasInvalid() || $input->hasMissing()) {
         throw new Vtx_UserException(Model_ErrorMessage::getFirstMessage($input->getMessages()));
     }
     return $input;
 }
开发者ID:Lazaro-Gallo,项目名称:psmn,代码行数:8,代码来源:AnnualResultData.php

示例13: _filterInputUserLocality

 protected function _filterInputUserLocality($params)
 {
     $input = new Zend_Filter_Input(array(), array('user_id' => array('NotEmpty', 'presence' => 'required'), 'enterprise_id' => array('allowEmpty' => true), 'regional_id' => array('allowEmpty' => true)), $params);
     if ($input->hasInvalid() || $input->hasMissing()) {
         throw new Vtx_UserException(Model_ErrorMessage::getFirstMessage($input->getMessages()));
     }
     return $input;
 }
开发者ID:Lazaro-Gallo,项目名称:psmn,代码行数:8,代码来源:UserLocality.php

示例14: _filterInputPresident

 protected function _filterInputPresident($params)
 {
     $input = new Zend_Filter_Input(array('*' => array('StripTags', 'StringTrim'), 'name' => array(), 'cpf' => array('Digits')), array('enterprise_id' => array('NotEmpty', 'presence' => 'required'), 'education_id' => array('NotEmpty', 'messages' => array('Escolha o Nivel de Escolaridade.'), 'presence' => 'required'), 'position_id' => array('NotEmpty', 'messages' => array('Escolha o Cargo.'), 'presence' => 'required'), 'find_us_id' => array('NotEmpty', 'messages' => array('Selecione o item como nos conheceu.'), 'presence' => 'required'), 'name' => array('NotEmpty', 'messages' => array('Digite o Nome da candidata.'), 'presence' => 'required'), 'nick_name' => array('allowEmpty' => true), 'cpf' => array('NotEmpty', 'messages' => array('Digite o CPF.'), new Vtx_Validate_Cpf()), 'email' => array('allowEmpty' => true), 'phone' => array('allowEmpty' => true), 'cellphone' => array('allowEmpty' => true), 'born_date' => array('NotEmpty', 'messages' => array('Digite a Data de Nascimento.'), 'presence' => 'required', new Zend_Validate_Date('dd/MM/yyyy')), 'gender' => array('allowEmpty' => true), 'newsletter_email' => array('allowEmpty' => true), 'newsletter_mail' => array('allowEmpty' => true), 'newsletter_sms' => array('allowEmpty' => true), 'agree' => array('NotEmpty', 'messages' => array('É necessário aceitar o regulamento'), 'presence' => 'required'), 'created' => array('allowEmpty' => true)), $params, array());
     if ($input->hasInvalid() || $input->hasMissing()) {
         throw new Vtx_UserException(Model_ErrorMessage::getFirstMessage($input->getMessages()));
     }
     return $input;
 }
开发者ID:Lazaro-Gallo,项目名称:psmn,代码行数:8,代码来源:President.php

示例15: _filterInputAnnualResult

 protected function _filterInputAnnualResult($params)
 {
     $input = new Zend_Filter_Input(array('*' => array('StringTrim'), 'value' => array()), array('question_id' => array(), 'mask' => array('NotEmpty', 'messages' => array('Escolha a máscara do Resultado Anual.')), 'value' => array('NotEmpty', 'messages' => array('Escolha o nome do Resultado Anual.'))), $params, array('presence' => 'required'));
     if ($input->hasInvalid() || $input->hasMissing()) {
         throw new Vtx_UserException(Model_ErrorMessage::getFirstMessage($input->getMessages()));
     }
     return $input;
 }
开发者ID:Lazaro-Gallo,项目名称:psmn,代码行数:8,代码来源:AnnualResult.php


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