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


PHP FormUtil::getFailedValidationObjects方法代码示例

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


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

示例1: edit

 function edit()
 {
     $ot = FormUtil::getPassedValue('ot', 'address', 'GET');
     $duplicate = FormUtil::getPassedValue('duplicate', 0, 'GET');
     $id = (int) FormUtil::getPassedValue('id', 0, 'GET');
     $startnum = FormUtil::getPassedValue('startnum', 1, 'GET');
     $letter = FormUtil::getPassedValue('letter', 0);
     $sort = FormUtil::getPassedValue('sort', ModUtil::getVar('AddressBook', 'addressbooktype') == 1 ? 'sortname ASC' : 'sortcompany ASC');
     $search = FormUtil::getPassedValue('search', 0);
     $category = FormUtil::getPassedValue('category', 0);
     $returnid = FormUtil::getPassedValue('returnid', 0, 'GET');
     $private = FormUtil::getPassedValue('private', 0);
     // Get user id
     if (UserUtil::isLoggedIn()) {
         $user_id = UserUtil::getVar('uid');
     } else {
         $user_id = 0;
     }
     $data = array();
     if ($id) {
         $object = new AddressBook_DBObject_Address();
         $data = $object->get($id);
         if ($duplicate) {
             $data['id'] = 0;
             LogUtil::registerStatus($this->__('Be careful. This is a duplicate!'));
         }
     } else {
         $data = FormUtil::getFailedValidationObjects('address');
         $data['id'] = 0;
     }
     // security check
     if (!(SecurityUtil::checkPermission('AddressBook::', '::', ACCESS_EDIT) || $user_id == $data['user_id'])) {
         return LogUtil::registerPermissionError();
     }
     $lang = ZLanguage::getLanguageCode();
     // get the custom fields
     $cus_where = "";
     $cus_sort = "cus_pos ASC";
     $cus_Array = new AddressBook_DBObject_CustomfieldArray();
     $customfields = $cus_Array->get($cus_where, $cus_sort);
     foreach ($customfields as $key => $customfield) {
         if (isset($customfield['name1']) && $customfield['name1'] && $lang != 'en') {
             $customfields[$key]['name'] = $customfield['name1'];
         }
     }
     $catregistry = CategoryRegistryUtil::getRegisteredModuleCategories('AddressBook', 'addressbook_address');
     $this->view->setCaching(false);
     // not suitable for cachin
     $this->view->assign('catregistry', $catregistry);
     $this->view->assign('address', $data);
     $this->view->assign('ot', $ot);
     $this->view->assign('user_id', $user_id);
     $this->view->assign('customfields', $customfields);
     $this->view->assign('startnum', $startnum);
     $this->view->assign('letter', $letter);
     $this->view->assign('category', $category);
     $this->view->assign('private', $private);
     $this->view->assign('sort', $sort);
     $this->view->assign('search', $search);
     $this->view->assign('returnid', $returnid);
     $this->view->assign('preferences', ModUtil::getVar('AddressBook'));
     $this->view->assign('lang', $lang);
     return $this->view->fetch('user_edit.tpl');
 }
开发者ID:nmpetkov,项目名称:AddressBook,代码行数:64,代码来源:User.php

示例2: getFailedValidationData

 /**
  * Get the object which failed validation.
  *
  * @return array The object's data value.
  */
 public function getFailedValidationData()
 {
     $this->_objData = FormUtil::getFailedValidationObjects($this->_objPath);
     return $this->_objData;
 }
开发者ID:Silwereth,项目名称:core,代码行数:10,代码来源:DBObject.php


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