当前位置: 首页>>代码示例>>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;未经允许,请勿转载。