Form Object

Introduction #

The Form object is the main object in Fluent Forms. It contains all properties of a particular form (i.e. form title, fields…).

Usage #

$form->id;  // returns the form id
$form->created_at; // returns the form created date
$form->created_by; // returns created by user id
$form->form_fields; // Returns the form fields definitions as JSON.

Properties #

ProperyTypeComment
idint(10) unsigned Auto Increment ID of the form
titlevarchar(255) Form Title
form_fieldslongtext NULL All the form Fields as JSON format
has_paymenttinyint(1) [0] if payment fields available or not
settingsArrayContains: confirmation, restrictions, layout as array keys
created_byint(11) NULL User ID of the form creator
created_attimestamp NULL Create Date
updated_attimestamp NULL Update Date

JSON Structure #

{
  "id": "82",
  "title": "Contact Form Demo (#82)",
  "status": "published",
  "appearance_settings": null,
  "form_fields": "{}", // will contain as raw JSON of form fields
  "has_payment": "0",
  "type": "form",
  "conditions": null,
  "created_by": "1",
  "created_at": "2019-11-25 16:55:30",
  "updated_at": "2019-11-25 16:55:33",
  "settings": {
    "confirmation": {
      "redirectTo": "samePage",
      "messageToShow": "Thank you for your message. We will get in touch with you shortly",
      "customPage": null,
      "samePageFormBehavior": "hide_form",
      "customUrl": null
    },
    "restrictions": {
      "limitNumberOfEntries": {
        "enabled": false,
        "numberOfEntries": null,
        "period": "total",
        "limitReachedMsg": null
      },
      "scheduleForm": {
        "enabled": false,
        "start": null,
        "end": null,
        "pendingMsg": "Form submission is not started yet.",
        "expiredMsg": "Form submission is now closed."
      },
      "requireLogin": {
        "enabled": false,
        "requireLoginMsg": null
      },
      "denyEmptySubmission": {
        "enabled": false,
        "message": "Sorry, you cannot submit an empty form. Let's hear what you wanna say."
      }
    },
    "layout": {
      "labelPlacement": "top",
      "helpMessagePlacement": "with_label",
      "errorMessagePlacement": "inline",
      "asteriskPlacement": "asterisk-left"
    },
    "id": "39"
  }
}

Powered by BetterDocs