Filled In SDK

Changing default messages

Filled In will output validation errors and other details using default HTML. Sometimes this may not be appropriate for your website. You can change it very easily and without modifying Filled In at all.

You can change the default messages by creating a directory called view/filled-in inside your theme directory. Within this you can create the following files:

  • error_filters.php – display filter errors
  • error_list.php – display other errors
  • head.php – HTML head code, for JavaScript and CSS
  • saved_uploads.php – display a list of saved uploads

The existing default messages are located in filled-in/view/default. Feel free to copy them to your theme directory and modify as necessary.

Developing a custom extension

Extensions live inside one of the filled-in/extension sub-directories, depending on what type of extension it is. You can create your own:

  1. Create a file in the chosen extension directory (e.g. filled-in/extension/filter/my_custom_filter.php)
  2. Create a new class that extends one of FI_Filter, FI_Pre, FI_Post, or FI_Results
  3. Fill in the required functions:
    • process or filter
    • name
    • show

    You can also fill in these optional functions if you want configuration options:

    • is_editable
    • edit
    • save
  4. Register the new class with: $this->register ('Your_Class_Name');

You can take a look at an existing extension to get a better idea of how it works.

Leave a comment

Your email address will not be published. Required fields are marked *