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


PHP CI_Form_validation类代码示例

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


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

示例1: __construct

 public function __construct($rules = array())
 {
     log_message('debug', '*** Hello from MY_Session ***');
     $this->CI =& get_instance();
     $this->CI->load->library("cimongo/cimongo");
     parent::__construct($rules);
 }
开发者ID:karojeff,项目名称:cimongo-codeigniter-mongodb-library,代码行数:7,代码来源:MY_Form_validation.php

示例2: error

 function error($field = '', $prefix = '', $suffix = '')
 {
     if (!empty($this->_field_data[$field]) && $this->_field_data[$field]['is_array']) {
         return ($prefix ? $prefix : $this->_error_prefix) . array_shift($this->_field_data[$field]['error']) . ($suffix ? $suffix : $this->_error_suffix);
     }
     return parent::error($field, $prefix, $suffix);
 }
开发者ID:jnaroogheh,项目名称:darvishi,代码行数:7,代码来源:MY_Form_validation.php

示例3: matches

 /**
  * Better version of standard matches method, this one will check if field is array and find appropriate value of this field.
  * @param string $str current value of form field.
  * @param string $field form field name, can be array.
  * @return boolean validation result.
  */
 public function matches($str, $field)
 {
     if (strpos($field, '[') !== FALSE) {
         $path = explode('[', str_replace(']', '', $field));
         $fld = isset($_POST[$path[0]]) ? $_POST[$path[0]] : FALSE;
         if ($fld === FALSE) {
             return FALSE;
         }
         if (count($path) > 1) {
             for ($i = 1; $i < count($path); $i++) {
                 $segment = $path[$i];
                 if (!isset($fld[$segment])) {
                     return FALSE;
                 }
                 $fld = $fld[$segment];
             }
         }
         if ($str == $fld) {
             return TRUE;
         }
         return FALSE;
     } else {
         return parent::matches($str, $field);
     }
 }
开发者ID:andrejjursa,项目名称:list-lms,代码行数:31,代码来源:LIST_Form_validation.php

示例4: __construct

   public function __construct()
   {
       parent::__construct();
       $this->_error_prefix = '<div class="alert alert-danger alert-dismissable">
 <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>';
       $this->_error_suffix = '</div>';
   }
开发者ID:kumarsivarajan,项目名称:ume-system,代码行数:7,代码来源:MY_Form_validation.php

示例5: array

 function __construct($rules = array())
 {
     $this->CI =& get_instance();
     //	$this->CI->load->library("cimongo/cimongo");
     parent::__construct($rules);
     $this->CI->load->language('form_validation');
 }
开发者ID:kulgee001,项目名称:yggdrasil,代码行数:7,代码来源:My_Form_validation.php

示例6: isset

 /**
  * ----------------------------------------------------------
  * Set Value: Get the value from a form
  * Extends method to return posted data for fields with no rules
  * ----------------------------------------------------------
  * 
  * @param string $field
  * @param string $default
  * @return string
  */
 function set_value($field = '', $default = '')
 {
     // no post?
     if (count($_POST) == 0) {
         return $default;
     }
     // no rules for this field?
     if (!isset($this->_field_data[$field])) {
         $this->set_rules($field, '', '');
         // fieldname is an array
         if ($this->_field_data[$field]['is_array']) {
             $keys = $this->_field_data[$field]['keys'];
             $value = $this->_traverse_array($_POST, $keys);
         } else {
             $value = isset($_POST[$field]) ? $_POST[$field] : FALSE;
         }
         // field was not in the post
         if ($value === FALSE) {
             return $default;
         } else {
             $this->_field_data[$field]['postdata'] = form_prep($value, $field);
         }
     }
     return parent::set_value($field, $default);
 }
开发者ID:boatechnology,项目名称:HealthAndWellness,代码行数:35,代码来源:MY_Form_validation.php

示例7: __construct

 public function  __construct($rules = array())
 {
     parent::__construct($rules);
     $this->CI = &get_instance();
     log_message('debug','BackendPro : MY_Form_validation class loaded');
     
 }
开发者ID:hungnv0789,项目名称:vhtm,代码行数:7,代码来源:NIW_Form_validation.php

示例8: array

 function __construct($config = array())
 {
     parent::__construct($config);
     parent::set_message('numeric_positive', 'The {field} field must contain a decimal greater or equal than 0.');
     parent::set_message('image_base64', 'The {field} field must be a image in base64 format.');
     parent::set_message('valid_base64', 'The {field} field must be base64 data.');
 }
开发者ID:lagaisse,项目名称:BrokenStuff,代码行数:7,代码来源:MY_Form_validation.php

示例9: run

 function run($group = '')
 {
     $return = parent::run($group);
     if ($return === FALSE) {
         $this->set_js_code();
     }
     return $return;
 }
开发者ID:navruzm,项目名称:navruz.net,代码行数:8,代码来源:MY_Form_validation.php

示例10: __construct

 /**
  * Crea y retorna el marco html para mostrar las validaciones
  * Esta funcion permite hacer referencia a cualquier recurso CodeIgniter
  * cargado o cargar otras nuevas sin inicializar las clases cada vez.
  * @return void
  */
 public function __construct($rules = array())
 {
     parent::__construct($rules);
     $this->CI =& get_instance();
     // Permite acceder a los recursos nativos de codeigniter.
     $this->_error_prefix = '<div class="alert alert-danger">' . '<button type="button" class="close" data-dismiss="alert">&times;</button>';
     $this->_error_suffix = '</div>';
 }
开发者ID:bogabrig,项目名称:copaer_np,代码行数:14,代码来源:MY_Form_validation.php

示例11: array

 /**
  * Constructor
  *
  * @access	public
  */
 function __construct($rules = array())
 {
     parent::__construct($rules);
     if ($this->CI->input->get('C') == 'addons_modules' && $this->CI->input->get('M') == 'show_module_cp' && isset($this->CI->_mcp_reference)) {
         $this->CI->_mcp_reference->lang =& $this->CI->lang;
         $this->CI =& $this->CI->_mcp_reference;
     }
 }
开发者ID:rmdort,项目名称:adiee,代码行数:13,代码来源:EE_Form_validation.php

示例12:

 function CI_TNotification($pstr_prefix = "<li>", $pstr_suffix = "</li>")
 {
     // smarty constructor
     parent::__construct();
     // set default delimiter
     $this->prefix = $pstr_prefix;
     $this->suffix = $pstr_suffix;
 }
开发者ID:zinzia,项目名称:kapalonline,代码行数:8,代码来源:Tnotification.php

示例13: set_rules

 /**
  *@desc Allow set a custom validation error message
  *
  */
 public function set_rules($field, $label = '', $rules = '', $message = '')
 {
     $rules = parent::set_rules($field, $label, $rules);
     if (!empty($message)) {
         $this->_custom_field_errors[$field] = $message;
     }
     return $rules;
 }
开发者ID:anhoale,项目名称:codeigniter-cms,代码行数:12,代码来源:MY_Form_Validation.php

示例14: set_rules

 public function set_rules($input_name, $input_name_display, $rule = NULL)
 {
     if ($rule == NULL) {
         $rule = $input_name_display;
         parent::set_rules($input_name, $input_name, $rule);
     } else {
         parent::set_rules($input_name, $input_name_display, $rule);
     }
 }
开发者ID:piranon,项目名称:gae,代码行数:9,代码来源:MY_Form_validation.php

示例15: money

 public function money($str)
 {
     //First check if decimal
     if (!parent::decimal($str)) {
         //Now check if integer
         return (bool) parent::integer($str);
     }
     return TRUE;
 }
开发者ID:dimplewraich,项目名称:finalproject,代码行数:9,代码来源:MY_Form_validation.php


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