hello everybody.
I want to [color=#333333][font=arial, sans-serif][size=4]display a[/size][/font][/color] [color=#333333][font=arial, sans-serif][size=4]thumbnail[/size][/font][/color] [color=#333333][font=arial, sans-serif][size=4]of an image[/size][/font][/color] [color=#333333][font=arial, sans-serif][size=4]instead of its[/size][/font][/color] [color=#333333][font=arial, sans-serif][size=4]name in the list page.[/size][/font][/color]
[color=#333333][font=arial,sans-serif][size=4]I use latest grocery crud version.[/size][/font][/color]
I use "callback_after_upload" but its not working.
My code is below:
function employee_setup ()
{
$this->grocery_crud->set_table('members');
$this->grocery_crud->set_subject('Member Setup');
$this->grocery_crud->required_fields('first_name','last_name','address_1','email','mobile','username','password');
$this->grocery_crud->set_rules('password','Password','required|min_length[6]|callback_password_check');
$this->grocery_crud->set_rules('username','Username','required|callback_username_check');
$this->grocery_crud->set_rules('email', 'Email', 'valid_email|required');
$this->grocery_crud->set_field_upload('image','img/mem_image');
$this->grocery_crud->callback_after_upload(array($this,'example_callback_after_upload'));
$this->grocery_crud->unset_columns('address_1','address_2','status','member_type','create_date');
$this->grocery_crud->change_field_type('password','password');
$this->grocery_crud->display_as('address_1','First Address')->display_as('address_2','Second Address');
$this->poscrud_output($output);
}
function example_callback_after_upload($uploader_response,$field_info, $files_to_upload)
{
$this->load->library('image_moo');
//Is only one file uploaded so it ok to use it with $uploader_response[0].
$file_uploaded = $field_info->upload_path.'/'.$uploader_response[0]->name;
$this->image_moo->load($file_uploaded)->resize(50,50)->save($file_uploaded,true);
return true;
}