HomeDocumentationTutorialsAdding a Heading to Forms

Adding a Heading to Forms

Overview

In this tutorial, we'll cover how to add a heading to your forms using a method from your configuration object, $objConfig->heading('field_name', 'field_label');. This method allows you to integrate headings seamlessly into your forms, making it easier to organize and present form sections clearly. The method takes two parameters:

 

  • field_name: The identifier for the heading.
  • field_label: The label displayed as the heading.

 

Here's a sample code to include a heading to your form;

 

PHP
 // Adding a heading to the form
$objConfig->heading('heading_name', 'heading_label');

 

Configuration in Your Application

For the configuration to work properly, it's important to include the 'field_name'  amongst the `addFields` and `editFields`. This ensures that the fields are correctly initialized and integrated into your form. This example shows how to configure the add and edit fields.

 

PHP
// Adding your heading to the add and edit forms
$objConfig->addFields(array('heading_name'));
$objConfig->editFields(array('heading_name'));

 

Conclusion

By following these steps, you can easily integrate headings into your forms using $objConfig->heading('heading_name', 'heading_label');. This method provides a straightforward way to organize and present different sections of your forms effectively.