Tag Archives: label

set_label()

set_label(mixed $col, mixed $label) : $this

Set form element label

Parameters

mixed $col
  • Database table column name
mixed $label
  • Label

Change Form Element Label

By default form displays database column name as input element label. You can change it with method set_label().

$dbForm = new C_DatabaseForm("SELECT * FROM Employees", "EmployeeID", "Employees");
$dbForm -> set_label("EmployeeID", "Employee ID");
$dbForm -> set_label("LastName", "Last Name");
$dbForm -> set_label("FirstName", "First Name");
$dbForm -> set_label("BirthDay", "DOB");
$dbForm -> display();

Live demo