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


PHP Editor::inData方法代碼示例

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


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

示例1: validate

 /**
  * Check the validity of the field based on the data submitted. Note that
  * this validation is performed on the wire data - i.e. that which is
  * submitted, before any setFormatter is run
  *
  * Called by the Editor / Join class instances - not expected for general
  * consumption - internal.
  *
  * @param array $data Data submitted from the client-side 
  * @param Editor $editor Editor instance
  * @param * $id Row id that is being validated
  * @return boolean|string `true` if valid, string with error message if not
  * @internal
  */
 public function validate($data, $editor, $id = null)
 {
     // Three cases for the validator - closure, string or null
     if (!count($this->_validator)) {
         return true;
     }
     $val = $this->_readProp($this->name(), $data);
     for ($i = 0, $ien = count($this->_validator); $i < $ien; $i++) {
         $validator = $this->_validator[$i];
         $processData = $editor->inData();
         $instances = array('action' => $processData['action'], 'id' => $id, 'field' => $this, 'editor' => $editor, 'db' => $editor->db());
         if (is_string($validator['func'])) {
             // Don't require the Editor namespace if DataTables validator is given as a string
             if (strpos($validator['func'], "Validate::") === 0) {
                 $res = call_user_func("\\DataTables\\Editor\\" . $validator['func'], $val, $data, $validator['opts'], $instances);
             } else {
                 $res = call_user_func($validator['func'], $val, $data, $validator['opts'], $instances);
             }
         } else {
             $func = $validator['func'];
             $res = $func($val, $data, $this, $instances);
         }
         // Check if there was a validation error and if so, return it
         if ($res !== true) {
             return $res;
         }
     }
     // Validation methods all run, must be valid
     return true;
 }
開發者ID:kienbk1910,項目名稱:RDCAdmin,代碼行數:44,代碼來源:Field.php

示例2: validate

 /**
  * Check the validity of the field based on the data submitted. Note that
  * this validation is performed on the wire data - i.e. that which is
  * submitted, before any setFormatter is run
  *
  * Called by the Editor / Join class instances - not expected for general
  * consumption - internal.
  *  @param array $data Data submitted from the client-side 
  *  @param Editor $editor Editor instance
  *  @return boolean Indicate if a field is valid or not.
  *  @internal
  */
 public function validate($data, $editor)
 {
     // Three cases for the validator - closure, string or null
     if (!$this->_validator) {
         return true;
     }
     $val = $this->_readProp($this->name(), $data);
     if (is_string($this->_validator)) {
         $processData = $editor->inData();
         $instances = array('action' => $processData['action'], 'id' => isset($processData['id']) ? str_replace($editor->idPrefix(), '', $processData['id']) : null, 'field' => $this, 'editor' => $editor, 'db' => $editor->db());
         // Don't require the Editor namespace if DataTables validator is given as a string
         if (strpos($this->_validator, "Validate::") === 0) {
             return call_user_func("\\DataTables\\Editor\\" . $this->_validator, $val, $data, $this->_validatorOpts, $instances);
         }
         return call_user_func($this->_validator, $val, $data, $this->_validatorOpts, $instances);
     }
     $validator = $this->_validator;
     return $validator($val, $data, $this);
 }
開發者ID:Symfomany,項目名稱:papsymfony,代碼行數:31,代碼來源:Field.php


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