Topics

{control} smarty function

The {control} tag is used to place controls within the form.  Generally, the class file for each of these controls is found in the '/framework/core/subsystems/forms/controls' folder.  It is called in the following format:

{control type=text name=firstname label="First Name" value=$record->firstname}

It accepts the following parameters which apply to most control types:

  • type - (required) the type of control to insert.  Available controls are:
    • antispam
    • autocomplete
    • buttongroup
    • checkbox
    • dropdown
    • radio
    • radiogroup
    • text
    • textarea
    • editor (or) html
    • list
    • listbuilder
    • calendar
    • popupdatecontrol
    • yuidatecontrol
    • yuicalendarcontrol
    • datetimecontrol
    • monthyear
    • user
    • state
    • country
    • quantity
    • tags
    • tagtree
    • files
    • filedisplay-types
    • anything else becomes a generic control
  • name - (required) name of the control, except buttongroup and antispam
  • id - the default is to use the 'name'
  • label - the label to display next to the control
  • default - the initial entry in the control
  • class - the style to assign to the control
  • value - the object property to attach to the control
  • required - the control must have a selected/entered value to pass validation
  • disabled - the control is displayed, but input is disabled
  • other control specific parameters are listed with that control help item
Loading Help