Customizing Fields

edited September 2015 in Modules
Hi,

I am trying to customize the look and feel of form fields. The example ( http://docs.getfuelcms.com/general/forms) shows how to do it... in some way..., but where do I add this code?


This is my model:

class todos_model extends Base_module_model { public $required = array('todo_name'); public $record_class = 'todos'; protected $key_field = 'todo_id'; public $foreign_keys = 'list_id'; function __construct() { /* reference to the db table */ parent::__construct('todos'); } }

and this is the line i want to add:

$fields['todo_name'] = array('type' => 'textarea', 'cols' => 40, 'rows' => 5, 'class' => 'no_editor');

Thanks for you efforts!

Wilhelmus

Comments

  • edited September 2015
    You'll over-ride the form_fields() function in your model
    function form_fields($values = array(), $related = array()) { $fields = parent::form_fields($values, $related); $fields['todo_name'] = array('type' => 'textarea', 'cols' => 40, 'rows' => 5, 'class' => 'no_editor'); return $fields; }
  • edited 8:27PM
    Thank you very much for your help. That's working just fine!

    Greetings from Germany,

    Wilhelmus
Sign In or Register to comment.