Welcome Guest, Not a member yet? Register   Sign In
Form Validation not loading config file
#1
Question 

Hi.

I'm trying to load the config set group from "form_validations.php" into a controller, but this always return false, without any errors;

CodeIgniter: 3.1.2, using autoload for form_validation.php library

form_validation.php
PHP Code:
<?php
$config 
= array(
 
       'signup' => array(
 
               array(
 
                       'field' => 'username',
 
                       'label' => 'Username',
 
                       'rules' => 'required'
 
               ),
 
               array(
 
                       'field' => 'password',
 
                       'label' => 'Password',
 
                       'rules' => 'required'
 
               ),
 
               array(
 
                       'field' => 'passconf',
 
                       'label' => 'Password Confirmation',
 
                       'rules' => 'required'
 
               ),
 
               array(
 
                       'field' => 'email',
 
                       'label' => 'Email',
 
                       'rules' => 'required'
 
               )
 
       ),
 
       'email' => array(
 
               array(
 
                       'field' => 'emailaddress',
 
                       'label' => 'EmailAddress',
 
                       'rules' => 'required|valid_email'
 
               ),
 
               array(
 
                       'field' => 'name',
 
                       'label' => 'Name',
 
                       'rules' => 'required|alpha'
 
               ),
 
               array(
 
                       'field' => 'title',
 
                       'label' => 'Title',
 
                       'rules' => 'required'
 
               ),
 
               array(
 
                       'field' => 'message',
 
                       'label' => 'MessageBody',
 
                       'rules' => 'required'
 
               )
 
       )
); 

Controller
PHP Code:
   public function Login_post()
 
   {
 
       
        $Status 
$this->form_validation->run('signup');
 
       var_dump($Status);
 
       var_dump($this->form_validation->error_array());
 
       var_dump($this->form_validation->error_string());
 
       die();



Return:
PHP Code:
bool(false)
array(
0) {
}
string(0"" 

Where i'm wrong?
Reply




Theme © iAndrew 2016 - Forum software by © MyBB