diff --git a/README.md b/README.md index 9d31a45..c132c0f 100644 --- a/README.md +++ b/README.md @@ -20,3 +20,240 @@ list set of data from your database : $this->mz_crud->set_config($config); $dataTable = $this->mz_crud->list_('users'); +##Insert + + $config['labels'] = array( 'username'=>'Alias' , 'email'=>'Email' , 'about_me'=> 'About Me' ); + $config['ignor'] = array('id'); + $config['check_duplicate'] = array( 'username' , 'email' ); + $config['redirect'] = base_url().'index/crudList/'; + $config['inp_type'] = array('username'=>'text' , 'about_me'=>'rich_textarea'); + + $this->mz_crud->set_config($config); + $insertTable = $this->mz_crud->add('users'); +##Edit + + $config['labels'] = array( 'username'=>'Alias' , 'email'=>'Email' , 'about_me'=> 'About Me' ); + $config['ignor'] = array('id'); + $config['check_duplicate'] = array( 'username' , 'email' ); + $config['redirect'] = base_url().'index/crudList/'; + $config['inp_type'] = array('username'=>'text' , 'about_me'=>'rich_textarea'); + + $this->mz_crud->set_config($config); + $insertTable = $this->mz_crud->edit( $id , 'users'); + + *see the sample code for more information + + +##Preferences + +The preferences described below . + +Note that not all preferences are availabel for every function. + +
Preference | +Default Value | +value | +Description | +Availability | +
---|---|---|---|---|
labels | +database column label | +array of 'column'=>'label' pairs | +Sets the label for each database column in the view | +all | +
ignor | +None | +array of columns | +Sets column that should be ignored in the operation | +all | +
redirect | +current_url() | +string | +Sets the redirect URL after operation (edit + , insert ) |
+add , edit | +
edit_url | +current_url() | +string | +Sets the Url to Edit function | +list_ | +
fail_url | +current_url() | +string | +Sets the redirect URL after operation fails | +add , edit | +
inp_type | +type="text" | +array of 'column'=>'input type' pairs | +Sets the Html input type for each column. | +all | +
options | +empty array | +2d array of 'column'=>array('option label'=>'option value') | +Sets the selectable options for input_type of (select , checkbox , radio ) | +all | +
check_duplicate | +None | +array of columns | +checks the database for duplicate before insert or edit | +all | +
md_options | +None | +array( 'add' , 'edit' , 'delete') | +Sets the moderating options for a list . | +list_ | +
id_fild | +id | +string | +sets the id colum in database | +edit | +
per_page | +0 | +int | +sets the per page option for pagination ( 0 == no pagination ) | +list_ | +
search | +empty array | +array of columns | +sets the searchable colums and adds a search option to the list | +list_ | +
sort | +empty array | +array of columns | +sets the sortable colums and adds a sort option to the list | +list_ | +
documentready | +ampty array | +array | +javascript commands to be run on document ready | +all | +
lang | +array('file'=>'crud' , 'folder'=>'crud') | +array | +sets the address for language file | +all | +