Overview
  • Package
  • Class

Packages

  • CT-API
  • CT-ChurchAuth
  • CT-ChurchCal
  • CT-ChurchCheckin
  • CT-ChurchCore
  • CT-ChurchDB
  • CT-ChurchFinance
  • CT-ChurchHome
  • CT-ChurchReport
  • CT-ChurchResource
  • CT-ChurchService
  • CT-ChurchTranslate
  • CT-ChurchWiki
  • CT-DB
  • CT-Form

Classes

  • CC_Button
  • CC_CCLI_Button
  • CC_Checkbox
  • CC_ColorField
  • CC_EmailField
  • CC_Field
  • CC_FileUpload
  • CC_HiddenField
  • CC_HTMLElement
  • CC_NumberField
  • CC_PasswordField
  • CC_TelefonField
  • CC_TextArea
  • CC_TextField
  • CC_UrlField
  • CTForm
  • CTModuleForm

Class CTForm

Html form

Direct known subclasses

CTModuleForm

Package: CT-Form
Located at system/churchcore/classes/CTForm.class.php

Methods summary

public
# __construct( string $name, string $validator, string $help_url = null, string/array $controlWidth = array('sm' => '6:6', 'md' => '5:7', 'lg' => '4:6') )

Constructor labelWidth and fieldWidth are column widths for bootstraps 12 column grid maybe a number (used for md) or an array ('sm' => '6:6', 'md' => '5:7', 'lg' => '4:6') values without : are used for labels, fieldwidth will be calculated

Constructor labelWidth and fieldWidth are column widths for bootstraps 12 column grid maybe a number (used for md) or an array ('sm' => '6:6', 'md' => '5:7', 'lg' => '4:6') values without : are used for labels, fieldwidth will be calculated

Parameters

$name
$validator
$validator; name of a user function to use for validation
$help_url
$help_url; last part of help on churchtools.de
$controlWidth
$controlWidth; trailing number for css classes like col-md-10 in form of array('md' => '3:9', ...)
public
# getBootstrapClasses( string/array $controlWidth )

create col-sm-x, col-md-x, col-lg-x bootstrap classes needed for form input styling returns array [label, field, fieldOffset, fieldWithOffset] if string is given it will be converted to array('md'=>string), if : is missed, value will used for label and field will be calculated

create col-sm-x, col-md-x, col-lg-x bootstrap classes needed for form input styling returns array [label, field, fieldOffset, fieldWithOffset] if string is given it will be converted to array('md'=>string), if : is missed, value will used for label and field will be calculated

Parameters

$controlWidth
$controlWidth; trailing numbers for css classes of label:field like col-md-10 in an array('md' => '3:9', ...)
public object,
# addField( object $field )

add control field or button to form, return added object

add control field or button to form, return added object

objects normally need: name, label, required, class, autofocus

Parameters

$field
$control, field or button

Returns

object,
$control
public
# addButton( string $button )

add button to form

add button to form

Parameters

$button
$label
public
# getName( )
public
# getLabelWidthClasses( )
public
# getFieldWidthClasses( )
public
# getFieldOffsetClasses( )
public
# getFieldWidthWithOffsetClasses( )
public
# setHeader( string $header, string $subheader = false )

set form header

set form header

Parameters

$header
$big, the title
$subheader
$small, default = false the subtitle
public
# setValidator( unknown $validator )

set validator

set validator

Parameters

$validator
public
# setPreventDoubleSubmission( )

prevent double submission by double-clicking on buttons

prevent double submission by double-clicking on buttons

public string
# render( string $horizontal = false, string $withHtmlEncoding = true )

render form

render form

Parameters

$horizontal
$withHtmlEncoding = true
$withHtmlEncoding
$horizontal = false

Returns

string
html content of form

Properties summary

public unknown $fields

array holding the fields of this form

array holding the fields of this form

# array ()
public array $widthClasses

width as columns out of 12 for bootstrap classes, in form of label:field, f.e. array('sm' => '6:6', md' => '3:9', 'lg' => '3:6')

width as columns out of 12 for bootstrap classes, in form of label:field, f.e. array('sm' => '6:6', md' => '3:9', 'lg' => '3:6')

# array()
API documentation generated by ApiGen