BEST Offers , For All Sximo 5 LTS licence Holer , Upgrade Licence For only $14 Normal Price on Codecanyon $31
New product Sximopress ( Wordpress Builder ) 1.0 has been realesed . download it now !

Sximo 5 LTS - Builder

Create Awesome & Professional CRUD Web Application CMS Within Minutes

Formating input post before insert update

Sometime , before inserting value from post Form , we need to format the values . So how to replace and format value from post before adding them to database table ?

You can call this as BeforeAction proccess.

In every controller , they are exists funtion postSave() .This method is for handling database insert and update into database .

Lets take a sample . we want to make sure , if user type they username in lowercase .
function postSave( $id =0)
{
    //.... code ... 
    if ($validator->passes()) {
        $data = $this->validatePost('users');
        // Replacement post value going here //
        $data['username'] = strtolower(Input::get('username'));
        // End replacement post value         
        $ID = $this->model->insertRow($data , Input::get('userID'));
            
    }        
            
    //.... code ...             
}

Please Register Purchased Code for full access Docs


Last Update : 2017-04-11 00:47:00