Welcome Guest, Not a member yet? Register   Sign In
validation custom error not working in saved rules
#1

(This post was last modified: 05-30-2020, 01:41 AM by nmaa3003.)

PHP Code:
    //--------------------------------------------------------------------
    // Rules
    //--------------------------------------------------------------------
    
public $merchant_register = [
        
'email' => [
            
'label' => 'Email Address'
            
'rules' => 'trim|required|valid_email|is_unique[merchant.email]'
            
'errors' => [
                
'is_unique' => 'Your email address has been registered'
            
]
        ],
        
'password' => [
            
'label' => 'Password'
            
'rules' => 'trim|required|string|min_length[8]|max_length[30]'
        
],
        
'confirm_password' => [
            
'label' => 'Confirm Password'
            
'rules' => 'required|matches[password]'
        
],
        
'mobile' => [
            
'label' => 'Mobile No'
            
'rules' => 'trim|required|numeric|min_length[10]'
        
]
    ]; 

the default error was the one shows in the screen when i put existing email.
this is saved rule in :

PHP Code:
<?php namespace Config;

class Validation 

and run by this command which is working good. just the custom error not showing.


PHP Code:
$validation $data['validation']->run($input'merchant_register'); 
Reply




Theme © iAndrew 2016 - Forum software by © MyBB