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); }
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); }
/** * 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); } }
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">×</button>'; $this->_error_suffix = '</div>'; }
function __construct($rules = array()) { $this->CI =& get_instance(); // $this->CI->load->library("cimongo/cimongo"); parent::__construct($rules); $this->CI->load->language('form_validation'); }
/** * ---------------------------------------------------------- * 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); }
public function __construct($rules = array()) { parent::__construct($rules); $this->CI = &get_instance(); log_message('debug','BackendPro : MY_Form_validation class loaded'); }
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.'); }
function run($group = '') { $return = parent::run($group); if ($return === FALSE) { $this->set_js_code(); } return $return; }
/** * 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">×</button>'; $this->_error_suffix = '</div>'; }
/** * 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; } }
function CI_TNotification($pstr_prefix = "<li>", $pstr_suffix = "</li>") { // smarty constructor parent::__construct(); // set default delimiter $this->prefix = $pstr_prefix; $this->suffix = $pstr_suffix; }
/** *@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; }
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); } }
public function money($str) { //First check if decimal if (!parent::decimal($str)) { //Now check if integer return (bool) parent::integer($str); } return TRUE; }
public function run($group = '') { // Is there a validation rule for the particular URI being accessed? $uri = $group == '' ? trim($this->CI->uri->ruri_string(), '/') : $group; if ($uri != '' and !isset($this->_config_rules[$uri])) { $this->load_rules_from_database($uri); } return parent::run($group); }
/** * __construct function. * * Just defines the parent and sets error prefixes globally * * @access public * @return void */ function __construct() { parent::__construct(); $this->_ci =& get_instance(); if (file_exists(APPPATH . 'config/form_validation.php')) { $this->_ci->config->load('form_validation'); } $this->_error_prefix = config_item('form_error_prefix') ? config_item('form_error_prefix') : ''; $this->_error_suffix = config_item('form_error_suffix') ? config_item('form_error_suffix') : ''; }
/** * Run * * Validates the CSRF token then runs normal validation. * * @param string The validation group name * @param bool If CSRF tokens should be used * @return bool */ public function run($group = '', $csrf_enabled = TRUE) { log_message('debug', 'My_Form_validation::run() called'); // Do we even have any data to process? Mm? if (count($_POST) == 0) { return FALSE; } if ($csrf_enabled) { $this->_validate_token(); } return parent::run($group); }
function __construct() { parent::__construct(); /** * Prefixos do form validate erro */ $this->_error_prefix = '<div class="alert bg-danger" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span> </button><i class="fa fa-exclamation-triangle"></i> '; $this->_error_suffix = '</div>'; }
function __construct($rules = array()) { parent::__construct(); $controller = CONTROLLER; if ($this->CI->input->post()) { $_POST += $this->CI->input->post(); } /* if(isset($_SESSION[CONTROLLER]['post'][$this->CI->$controller->id])){ $_POST=array_merge_recursive($_POST,$_SESSION[CONTROLLER]['post'][$this->CI->$controller->id]); } */ }
public function set_rules($field, $label = '', $rules = '') { // No reason to set rules if we have no POST data if (count($_POST) == 0) { return $this; } if (is_array($field) && $field !== array_values($field)) { foreach ($field as $key => $value) { $label = !empty($value[1]) ? $value[1] : humanize($key); parent::set_rules($key, $label, $value[0]); } return $this; } parent::set_rules($field, $label, $rules); }
function __construct() { parent::__construct(); $CI =& get_instance(); }
function __construct() { parent::__construct(); }
public function run($module = '', $group = '') { is_object($module) and $this->CI =& $module; return parent::run($group); }
function MY_Form_validation() { parent::CI_Form_validation(); }
public function __construct($rules = array()) { parent::__construct($rules); $this->lang->load('form_validation', 'greek'); }
public function __construct($rules = array()) { parent::__construct(); $this->CI->load->database(); log_message('debug', "My Form Validation Class Initialized"); }
public function __construct() { parent::__construct(); $this->CI =& get_instance(); }
function MY_Form_validation($rules = array()) { parent::__construct($rules); }
function __construct($rules = array()) { parent::__construct($rules); }