⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Boolean field & Image upload field & Default date



Гэрэлт-Од Гоцбаяр

Гэрэлт-Од Гоцбаяр
  • profile picture
  • Member

Posted 27 February 2013 - 14:31 PM

1. How I configure field as boolean?

2. How I configure field as image file upload?

3. Is there any example about image upload field with Image cropping?

4. How can I set default date for datetime type field? (current date)

 

My current code isn't working.

 

public function we() {

        $this->grocery_crud->set_table('we');
        $this->grocery_crud->display_as('title','Гарчиг')->display_as('body', 'Контент')->display_as('titlelong', 'Урт гарчиг');
        $this->grocery_crud->required_fields('title','body');
        $this->grocery_crud->set_field_upload('image','assets/uploads/images');
        $this->grocery_crud->change_field_type('featured', 'true_false');
        $output = $this->grocery_crud->render();

        $this->_example_output($output);
    }

 

 


Гэрэлт-Од Гоцбаяр

Гэрэлт-Од Гоцбаяр
  • profile picture
  • Member

Posted 27 February 2013 - 14:36 PM

Forget question number 1. I found answer from here: http://www.grocerycrud.com/documentation/options_functions/change_field_type

 

Update: forget question number 2.