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


PHP Zend_View_Interface::formErrors方法代碼示例

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


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

示例1: _recurseForm

 /**
  * Recurse through a form object, rendering errors
  *
  * @param  Zend_Form $form
  * @param  Zend_View_Interface $view
  * @return string
  */
 protected function _recurseForm(Zend_Form $form, Zend_View_Interface $view)
 {
     $content = '';
     $custom = $form->getCustomMessages();
     if ($this->getShowCustomFormErrors() && count($custom)) {
         $content .= $this->getMarkupListItemStart() . $view->formErrors($custom, $this->getOptions()) . $this->getMarkupListItemEnd();
     }
     foreach ($form->getElementsAndSubFormsOrdered() as $subitem) {
         if ($subitem instanceof Zend_Form_Element && !$this->getOnlyCustomFormErrors()) {
             $messages = $subitem->getMessages();
             if (count($messages)) {
                 $subitem->setView($view);
                 $content .= $this->getMarkupListItemStart() . $this->renderLabel($subitem, $view) . $view->formErrors($messages, $this->getOptions()) . $this->getMarkupListItemEnd();
             }
         } else {
             if ($subitem instanceof Zend_Form && !$this->ignoreSubForms()) {
                 $content .= $this->getMarkupListStart() . $this->_recurseForm($subitem, $view) . $this->getMarkupListEnd();
             }
         }
     }
     return $content;
 }
開發者ID:jpbender,項目名稱:mage_virtual,代碼行數:29,代碼來源:FormErrors.php

示例2: _recurseForm

 /**
  * Recurse through a form object, rendering errors
  * 
  * @param  Zend_Form $form 
  * @param  Zend_View_Interface $view 
  * @return string
  */
 protected function _recurseForm(Zend_Form $form, Zend_View_Interface $view)
 {
     $content = '';
     $errors = $form->getMessages();
     if ($form instanceof Zend_Form_SubForm || @$form->isSubForm) {
         $name = $form->getName();
         if (1 == count($errors) && array_key_exists($name, $errors)) {
             $errors = $errors[$name];
         }
     }
     if (empty($errors)) {
         return $content;
     }
     foreach ($errors as $name => $list) {
         $element = $form->{$name};
         if (null === $element && is_numeric($name)) {
             $content .= $this->getMarkupListItemStart() . $view->formErrors((array) $list, $this->getOptions()) . $this->getMarkupListItemEnd();
         } else {
             if ($element instanceof Zend_Form_Element) {
                 $element->setView($view);
                 $content .= $this->getMarkupListItemStart() . ($this->_skipLabels ? '' : $this->renderLabel($element, $view)) . $view->formErrors($list, $this->getOptions()) . $this->getMarkupListItemEnd();
             } elseif (!$this->ignoreSubForms() && $element instanceof Zend_Form) {
                 $content .= $this->_recurseForm($element, $view);
             }
         }
     }
     return $content;
 }
開發者ID:febryantosulistyo,項目名稱:ClassicSocial,代碼行數:35,代碼來源:FormErrors.php


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