See also
/app_extend/add_field
Most fields added need a column in the model associated MYSQL table.
Fields are then added in the CRUD form using the fields key in the configuration file.
Syntax used is using a existing feature, which defines how a column displays.
Moreover, Novius OS team implemented renderers, which allows more freedom. Some renderer allow to select medias, pages, date.
Configuration example:
<?php
return array(
'name' => array(
'label' => 'Text displayed next to field',
'form' => array(
'type' => 'text',
'value' => 'Default field',
),
'validation' => array(),
);
Bold text is the type property value:
<?php
return array(
'gender' => array(
'label' => 'Gender',
'form' => array(
'type' => 'select',
'options' => array(
'm' => 'Male',
'f' => 'Female',
),
),
'validation' => array('required'),
),
);
tag property can be used to force HTML tab, for the submit button case.
FuelPHP use automatically value as button text.
<?php
return array(
'save' => array(
'form' => array(
'type' => 'submit',
'tag' => 'button',
'value' => 'Save',
),
),
);
New in version Chiba2.1.
The save key no longer required in CRUD fields configuration.
renderers list is available in API documentation.