A full example with the most used functions
Below there is an example with the functions that we use the most of the times
As all the methods return $this, you can write faster code by adding only the symbol ->
function full_example() { $crud = new grocery_CRUD(); $crud->set_table('customers') ->set_subject('Customer') ->columns('customerName','contactLastName','phone','city','country','creditLimit') ->display_as('customerName','Name') ->display_as('contactLastName','Last Name'); $crud->fields('customerName','contactLastName','phone','city','country','creditLimit'); $crud->required_fields('customerName','contactLastName'); $output = $crud->render(); $this->_example_output($output); }
Note: The below example is an iframe so it might appeared with a scroll bar. If you like you can view the example
on a new tab