bbcconfig

berguna untuk menyimpan data config tiap module, data config tersebut akan disimpan pada table bbc_config dan bisa diakses di berbagai module maupun block meskipun di luar module tersebut

Contoh Penggunaan:

echo _class('bbcconfig', $config, 'config', $sys->module_id, 'Judul Form')->show();
Adapun contoh $config lihat contoh di bawah:
$config = array(
  'inputtext' => array(
    'text'      => 'Sample Text Input',
    'tips'      => 'text to display under the input in small font-size',
    'add'       => 'additional text after the input',
    'help'      => 'popup tips to display right after the title',
    'type'      => 'text', // type of input
    'language'  => true,   // is input support multiple language, default value is false
    'attr'      => ' size="40"', // additional attribute for the input
    'default'   => 'insert default value',
    'mandatory' => 1, // is this field must be filled in (compulsory). Eg. 1 or 0
    'checked'   => 'any' // validate input eg. 'any' / 'email' / 'url' / 'phone' / 'number'
    ),
  'plain' => array(
    'text'    => 'Sample Plaintext',
    'tips'    => 'text to display under the input in small font-size',
    'add'     => 'additional text after the input',
    'help'    => 'popup tips to display right after the title',
    'type'    => 'plain',
    'default' => 'this is the text'
    ),
  'radio' => array(
    'text'      => 'Sample Radio input',
    'tips'      => 'text to display under the input in small font-size',
    'add'       => 'additional text after the input',
    'help'      => 'popup tips to display right after the title',
    'type'      => 'radio',
    'delim'     => " -- ",
    'option'    => array('yes', 'no'),
    'default'   => '0',
    'mandatory' => 1, // is this field must be filled in (compulsory). Eg. 1 or 0
    'checked'   => 'any' // validate input eg. 'any' / 'email' / 'url' / 'phone' / 'number'
    ),
  'select' => array(
    'text'      => 'Sample Select input',
    'tips'      => 'text to display under the input in small font-size',
    'add'       => 'additional text after the input',
    'help'      => 'popup tips to display right after the title',
    'type'      => 'select',
    'is_arr'    => true,     // if this is true, user has multiple selection
    'option'    => array(1 => 'yes', 0 => 'no'),
    'default'   => 'no',
    'mandatory' => 0, // is this field must be filled in (compulsory). Eg. 1 or 0
    'checked'   => 'any' // validate input eg. 'any' / 'email' / 'url' / 'phone' / 'number'
    ),
  'checkbox' => array(
    'text'      => 'Sample Checkbox input',
    'tips'      => 'text to display under the input in small font-size',
    'add'       => 'additional text after the input',
    'help'      => 'popup tips to display right after the title',
    'type'      => 'checkbox',
    'delim'     => " -- ",
    'option'    => array(1 => 'yes', 0 => 'no'), // leave it empty or unset for one checkbox and value
    'default'   => 1,
    'mandatory' => 0, // is this field must be filled in (compulsory). Eg. 1 or 0
    'checked'   => 'any' // validate input eg. 'any' / 'email' / 'url' / 'phone' / 'number'
    ),
  'checkbox2' => array(
    'text'      => 'Sample Checkbox with one option',
    'tips'      => 'text to display under the input in small font-size',
    'add'       => 'additional text after the input',
    'help'      => 'popup tips to display right after the title',
    'type'      => 'checkbox',
    'option'    => 'activate',
    'default'   => 1,
    'mandatory' => 0, // is this field must be filled in (compulsory). Eg. 1 or 0
    'checked'   => 'any' // validate input eg. 'any' / 'email' / 'url' / 'phone' / 'number'
    ),
  'textarea' => array(
    'text'      => 'Sample textarea input',
    'tips'      => 'text to display under the input in small font-size',
    'add'       => 'additional text after the input',
    'help'      => 'popup tips to display right after the title',
    'type'      => 'textarea',
    'language'  => true,       // is input support multiple language, default value is false
    'default'   => 'sfdghgfhg',// default value
    'mandatory' => 0,       // is this field must be filled in (compulsory). Eg. 1 or 0
    'format'    => 'none',    // what format you want to use eg. none | code | html
    'checked'   => 'any' // validate input eg. 'any' / 'email' / 'url' / 'phone' / 'number'
    )
  );
//CHANGE 'default' TO 'force' IF IN EDIT CONDITION...

 

File Path: includes/class/bbcconfig.php berguna untuk menyimpan data config tiap module, data config tersebut akan disimpan pada table bbc_config dan bisa diakses di berbagai module maupun block

0 Comment

Post Your Comment

Terakhir Dilihat

Method Tersedia