Skip to content

function validatePost

Taufik Firmansyah edited this page Jan 29, 2015 · 1 revision

This function used to filter and form all submited form . you can setting/format all filter form using Form Editor at module management .

Usage

// before insert , validate post submit 
$data = $this->validatePost('module_name');
// Insert / update into database
$ID = $this->model->insertRow($data , Input::get('primary_key'));

Function will automate filtering wich post field are allowed to save and format it before inserting into database .

Overide post value You can do before insert . example you need to format password before save it into database .

$data = $this->validatePost('module_name');
// reformat / overide
$data['password'] = md5(Input::get('password'));
// Insert / update into database
$ID = $this->model->insertRow($data , Input::get('primary_key'));

Module Structure

BaseController

BaseModel

SiteHelpers

Clone this wiki locally