Sunday, January 5, 2014

Fungsi-fungsi lain di GroceryCRUD

- Set_relation( string $field_name , string  $related_table, string  $related_title_field  [, mixed $where [,
Contoh :
Function employees_management()
{
    $crud = new grocery_CRUD();
    $crud->set_theme('datatables');
    $crud->set_table('employees');
    $crud->display_as('officeCode','Office City');
    $crud->set_subject('Employee');
    $crud->set_relation('officeCode','offices','city');
    $output = $crud->render();
    $this->_example_output($output);
} 
 
- set_field_upload( string $field_name, string $upload_path) 
Contoh :
function employees_management()
{
    $crud = new grocery_CRUD();
    $crud->set_theme('datatables');
    $crud->set_table('employees');
    $crud->set_relation('officeCode','offices','city');
    $crud->display_as('officeCode','Office City');
    $crud->set_subject('Employee');
    $crud->required_fields('lastName');
    $crud->set_field_upload('file_url','assets/uploads/files');
    $output = $crud->render();
    $this->_example_output($output);        
}

No comments:

Post a Comment