本文整理汇总了PHP中CI_Form_validation类的典型用法代码示例。如果您正苦于以下问题:PHP CI_Form_validation类的具体用法?PHP CI_Form_validation怎么用?PHP CI_Form_validation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CI_Form_validation类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: MY_Form_validation
function MY_Form_validation()
{
parent::CI_Form_validation();
}
开发者ID:khanals,项目名称:rbs-ext,代码行数:4,代码来源:MY_Form_validation.php
示例2: __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
示例3: 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
示例4: 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
示例5: __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">×</button>';
$this->_error_suffix = '</div>';
}
开发者ID:kumarsivarajan,项目名称:ume-system,代码行数:7,代码来源:MY_Form_validation.php
示例6: 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
示例7: 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
示例8: __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
示例9: 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
示例10: 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
示例11: __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">×</button>';
$this->_error_suffix = '</div>';
}
开发者ID:bogabrig,项目名称:copaer_np,代码行数:14,代码来源:MY_Form_validation.php
示例12: 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
示例13:
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
示例14: 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
示例15: 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
示例16: 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
示例17: run
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);
}
开发者ID:haryx8,项目名称:freegw,代码行数:9,代码来源:MY_Form_validation.php
示例18:
/**
* __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') : '';
}
开发者ID:NaszvadiG,项目名称:Base-CodeIgniter-App,代码行数:18,代码来源:MY_Form_validation.php
示例19: run
/**
* 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);
}
开发者ID:razorlegacy,项目名称:pyrocms,代码行数:21,代码来源:MY_Form_validation.php
示例20:
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>';
}
开发者ID:andersonbezerrasantos,项目名称:controle_lab,代码行数:12,代码来源:MY_Form_validation.php
注:本文中的CI_Form_validation类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论