public function __construct() { parent::__construct(); // Set the validation rules $val_rules = array(array('field' => 'id'), array('field' => 'user_id'), array('field' => 'name', 'label' => 'lang:site.descriptive_name', 'rules' => 'trim|max_length[100]|required'), array('field' => 'domain', 'label' => 'lang:site.domain', 'rules' => 'trim|callback__valid_domain|max_length[100]|required'), array('field' => 'ref', 'label' => 'lang:site.ref', 'rules' => 'trim|alpha_dash|callback__underscore|min_length[1]|max_length[20]|required'), array('field' => 'username', 'label' => 'lang:user_username', 'rules' => 'trim|required'), array('field' => 'first_name', 'label' => 'lang:user_first_name', 'rules' => 'trim|required'), array('field' => 'last_name', 'label' => 'lang:user_last_name', 'rules' => 'trim|required'), array('field' => 'email', 'label' => 'lang:user_email', 'rules' => 'trim|required|valid_email')); $val_create = array(array('field' => 'password', 'label' => 'lang:user_password', 'rules' => 'trim|min_length[6]|required')); $val_edit = array(array('field' => 'password', 'label' => 'lang:user_password', 'rules' => 'trim')); $this->site_validation_rules = array_merge($val_rules, $this->method == 'create' ? $val_create : $val_edit); }
function __construct() { parent::__construct(); /* load lang */ $this->lang->load('home'); $this->load->model('produk_model', 'pm'); $this->load->model('promo_model', 'pm2'); /* load model */ }
public function __construct() { parent::__construct(); $this->val_rules = array(); $settings = $this->settings_m->get_settings(); // set the validation rules dynamically foreach ($settings as $slug => $value) { $this->val_rules[] = array('field' => $slug, 'label' => lang('site.' . $slug), 'rules' => 'trim|required'); } }
public function __construct() { parent::__construct(); ci()->ref = $this->ref = $this->uri->segment(4); ci()->type = $this->type = $this->uri->segment(5); ci()->slug = $this->slug = $this->uri->segment(6); ci()->shared = $this->shared = (bool) $this->uri->segment(7); $this->db->set_dbprefix($this->ref . '_'); $this->load->model('addons_m'); }
function __construct(){ parent::__construct(); /* load config */ $this->load->config('conf_login'); /* load lang */ $this->lang->load('login'); /* load model */ $this->load->model('login_model', 'lm'); /* to check system speed and query --> just for admin */ //$this->output->enable_profiler(TRUE); }
public function __construct() { parent::__construct(); // Set the validation rules $val_rules = array(array('field' => 'id'), array('field' => 'username', 'label' => 'lang:user_username', 'rules' => 'trim|required'), array('field' => 'email', 'label' => 'lang:user_email', 'rules' => 'trim|required|valid_email')); $val_create = array(array('field' => 'password', 'label' => 'lang:user_password', 'rules' => 'trim|' . 'min_length[' . config_item('min_password_length') . ']|' . 'max_length[' . config_item('max_password_length') . ']|' . 'required'), array('field' => 'confirm_password', 'label' => 'lang:user_confirm_password', 'rules' => 'trim|' . 'min_length[' . config_item('min_password_length') . ']|' . 'max_length[' . config_item('max_password_length') . ']|' . 'required|' . 'matches[password]')); $val_edit = array(array('field' => 'password', 'label' => 'lang:user_password', 'rules' => 'trim|matches[confirm_password]'), array('field' => 'confirm_password', 'label' => 'lang:user_confirm_password', 'rules' => 'trim|matches[password]')); if ($this->method == 'add') { $this->user_validation_rules = array_merge($val_rules, $val_create); } else { $this->user_validation_rules = array_merge($val_rules, $val_edit); } // login validation $this->login_rules = array(array('field' => 'email', 'label' => lang('email_label'), 'rules' => 'required|callback__check_login'), array('field' => 'password', 'label' => lang('password_label'), 'rules' => 'required')); }