EE1 Functions Reference
Developing a celltype for Matrix is just as easy as creating a FieldFrame-based fieldtype. In fact, the first step is to create one.
The only function required to get your fieldtype to show up as an Matrix celltype is display_cell(). Below is a list of all the functions you can add.
Functions at a Glance
display_cell_settings()save_cell_settings()display_cell()save_cell()post_save_cell()delete_rows()
display_cell_settings( $settings )
Add custom cell settings to the Matrix Configuration setting within the Edit Field form
Arguments
| Type | Description | |
|---|---|---|
$settings |
Array | Previously-saved celltype settings for the column |
Return
HTML to be inserted below the Cell Type select
save_cell_settings( $settings )
Modify the Matrix cell settings’ post data before it gets saved to the database
Arguments
| Type | Description | |
|---|---|---|
$data |
Array | Post data that came from any inputs you created in display_cell_settings |
Return
Array with the modified post data
display_cell( $cell_name, $data, $settings )
Create the custom Matrix cell HTML for the Publish form
Arguments
| Type | Description | |
|---|---|---|
$cell_name |
String | Name you give your cell input |
$data |
Mixed | Previously-saved cell data |
$settings |
Array | The cell settings |
Return
String of HTML to be inserted into the Matrix cell in the Publish form
save_cell( $data, $settings, $entry_id )
Modify the Matrix cell’s post data before it gets saved to the database
Arguments
| Type | Description | |
|---|---|---|
$data |
Mixed | The cell’s post data |
$settings |
Array | The cell settings |
$entry_id |
Mixed | The entry’s ID |
Return
The modified post data
post_save_cell( $data, $settings, $entry_id, $row_id )
Perform actions after a row has been saved
Arguments
| Type | Description | |
|---|---|---|
$data |
Mixed | The cell’s post data |
$settings |
Array | The cell settings |
$entry_id |
Mixed | The entry’s ID |
$row_id |
Number | The entry’s ID |
delete_rows( $row_ids )
Perform actions right before rows get deleted
Arguments
| Type | Description | |
|---|---|---|
$row_ids |
Array | The row IDs about to be deleted |