<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}

/**
 * Form for module MODULE
 *
 * @author CIEXT skeleton
 */
class NAME_form extends \Ciext\Form\AbstractForm
{

    public function get_rules()
    {
        return [
            [
                'field' => 'code',
                'label' => $this->ci->lang->line('Code'),
                'rules' => [
                    'trim',
                    'max_length[255]',
//                    ['is_available', [$this, 'rule_is_available']]
                ]
            ],
        ];
    }

//    public function rule_is_available($value = '')
//    {
//        if (!$value) {
//            $this->ci->form_validation->set_message('is_available', $this->ci->lang->line('Your `{field}` dosn`t exist'));
//            return FALSE;
//        } else {
//            return TRUE;
//        }
//    }

}
