clearFusionCMS 3.0.0
  • Package
  • Class
  • Tree
  • Deprecated

Packages

  • clearFusionCMS
    • module
      • cloudflare
      • comments
      • content
      • forms
      • members
      • search
  • fusionLib
  • None

Classes

  • _flFormGroup
  • _flUtf8Base
  • flAcMgr
  • flApiDbInstaller
  • flApiKeyMgr
  • flApiServer
  • flApiService
  • flApp
  • flAuthTOTP
  • flBufferCode
  • flBufferCss
  • flBufferJs
  • flCache
  • flCacheAPC
  • flCacheDb
  • flCacheDbInstaller
  • flCacheDummy
  • flCacheFile
  • flCacheFunction
  • flCacheMemcache
  • flCacheMemcached
  • flCacheOutput
  • flCacheRedis
  • flCacheSqlite
  • flConfig
  • flConfigDb
  • flConfigDbInstaller
  • flConfigFile
  • flConfigIni
  • flController
  • flControllerAction
  • flDate
  • flDateTzMenu
  • flDb
  • flDbInstaller
  • flDbInstallerInterface
  • flDbMySQL
  • flDbMySQLi
  • flDbMySQLiResult
  • flDbMySQLResult
  • flDbNestedSet
  • flDbResult
  • flDbSQLite
  • flDbSQLite3
  • flDbSQLite3Result
  • flDbSQLiteResult
  • flEmail
  • flEvent
  • flEventDbInstaller
  • flEventManager
  • flExceptionErrorController
  • flExceptionReporter
  • flForm
  • flFormBuilder
  • flFormDecorator
  • flFormDecoratorDl
  • flFormDecoratorDtDd
  • flFormDecoratorFieldset
  • flFormDecoratorForm
  • flFormDecoratorLi
  • flFormDecoratorList
  • flFormDecoratorUl
  • flFormElement
  • flFormElementButton
  • flFormElementCheckbox
  • flFormElementChecklist
  • flFormElementEmail
  • flFormElementFile
  • flFormElementHidden
  • flFormElementImage
  • flFormElementInteger
  • flFormElementNumber
  • flFormElementPane
  • flFormElementPassword
  • flFormElementRadio
  • flFormElementRecaptcha
  • flFormElementSearch
  • flFormElementSelect
  • flFormElementSubmit
  • flFormElementText
  • flFormElementTextArea
  • flFormElementTextSuggest
  • flFormElementUri
  • flFormElementWYSIWYG
  • flFormValidator
  • flFormValidatorAttribMax
  • flFormValidatorAttribMin
  • flFormValidatorCustomJS
  • flFormValidatorEmail
  • flFormValidatorEquals
  • flFormValidatorInteger
  • flFormValidatorMax
  • flFormValidatorMaxChecklist
  • flFormValidatorMaxLength
  • flFormValidatorMin
  • flFormValidatorMinChecklist
  • flFormValidatorMinLength
  • flFormValidatorMultiEmail
  • flFormValidatorNotEquals
  • flFormValidatorNumber
  • flFormValidatorRegex
  • flFormValidatorRequired
  • flFormValidatorSameAs
  • flFormValidatorUri
  • flFtpClient
  • flGravatar
  • flHttpClient
  • flHttpClientCookie
  • flImage
  • flImageFilter
  • flImageFilterBrightness
  • flImageFilterColorize
  • flImageFilterContrast
  • flImageFilterEdgeDetect
  • flImageFilterEmboss
  • flImageFilterGaussianBlur
  • flImageFilterGrayscale
  • flImageFilterMeanRemoval
  • flImageFilterNegative
  • flImageFilterPixelate
  • flImageFilterSelectiveBlur
  • flImageFilterSepia
  • flImageFilterSepia2
  • flImageFilterSmooth
  • flIntegrity
  • flKeygen
  • flLog
  • flLogHandlerChrome
  • flLogHandlerLoggly
  • flLogHandlerPapertrail
  • flLogHandlerSlack
  • flMimeTypes
  • flModuleDbInstaller
  • flModuleMgr
  • flRegistry
  • flRequest
  • flRequestDbInstaller
  • flRequestThrottle
  • flResponse
  • flRouter
  • flRouterRoute
  • flRssChannel
  • flRssClient
  • flRssItem
  • flSearch
  • flSearchIndexer
  • flSearchManager
  • flSearchResults
  • flSearchTags
  • flSession
  • flSessionData
  • flSessionDb
  • flSessionDbInstaller
  • flSessionFile
  • flSessionMemcache
  • flSessionMemcached
  • flSessionRedis
  • flTemplateDbInstaller
  • flTemplateEngine
  • flTemplateManager
  • flTextHTML
  • flTextSplitWords
  • flTextStemmer
  • flTextStemmerEn
  • flTextStrip
  • flTimer
  • flUri
  • flUser
  • flUserAdapter
  • flUserAdapterRemote
  • flUserDbInstaller
  • flUserMgr
  • flUserPwdGen
  • flUserServerApiV1
  • flUtf8
  • flUuid
  • flVariables
  • flVariablesDbInstaller
  • flWidgetBreadcrumb
  • flWidgetFloatingActionMenu
  • flWidgetPagination
  • flWidgetTable
  • flWidgetTabs
  • flWidgetToolbar
  • flWidgetTreeChildNode
  • flWidgetTreeLinkNode
  • flWidgetTreeNode
  • flWidgetTreeView
  • fusionLib

Interfaces

  • flFormElementWYSIWYGCodeInterface
  • flFormElementWYSIWYGInterface
  • flFormElementWYSIWYGTransformInterface
  • flLogHandler
  • flModuleInstallInterface

Exceptions

  • flAcException
  • flAppException
  • flCacheException
  • flConfigException
  • flDateException
  • flDbException
  • flEventException
  • flException
  • flExceptionBadRequest
  • flExceptionForbidden
  • flExceptionLoadClass
  • flExceptionNotFound
  • flExceptionPHP
  • flFormException
  • flHttpClientException
  • flImageException
  • flRegistryException
  • flRequestThrottleException
  • flRouterException
  • flSessionException
  • flTemplateEngineException
  • flUserException
  • flVariablesException
  • flWidgetException

Functions

  • __
  • __noop
  • _flErrorHandler
  • _n
  • _n_noop

Class flForm

flForm Class

Class to define a form and collect the form elements together.

Package: fusionLib
Copyright: Copyright (c) 2007 - 2016 fusionLib. All rights reserved.
Located at system/libs/Form/flForm.php

Methods summary

public
# __construct( flRequest $request, string $name, string $action, boolean $post = true, flFormDecoratorList $frmDecorators = null, flFormDecoratorList $grpDecorators = null, flFormDecoratorList $elemDecorators = null )

Construct and initialise the form.

Construct and initialise the form.

Parameters

$request
The request object.
$name
The name of the form.
$action
The action or URI to send the form submission to.
$post
true if the form should be submitted with POST or false for GET
$frmDecorators
Optional decorators for the form.
$grpDecorators
Optional default decorators for groups.
$elemDecorators
Optional default decorators for group elements.
public flForm
# addElement( flFormElement $elem )

Add a form element to the form.

Add a form element to the form.

Parameters

$elem
The form element to add.

Returns

flForm
This object.
public flFormElement
# getElement( string $name )

Get the nameed element.

Get the nameed element.

Parameters

$name
The name of the element to get.

Returns

flFormElement
The element.
public flForm
# groupElements( string $name, array $elements, flFormDecoratorList $grpDecorators = null, flFormDecoratorList $elemDecorators = null )

Group elements, the elements must already be added.

Group elements, the elements must already be added.

Parameters

$name
The name of the group.
$elements
The list of elements to put in the group.
$grpDecorators
Optional decorators for the group.
$elemDecorators
Optional decorators for the group elements.

Returns

flForm
This object.

Throws

flFormException
public boolean
# hasGroup( string $name )

Test if the form has a group of the given name.

Test if the form has a group of the given name.

Parameters

$name
The name of the group to add.

Returns

boolean
true if the group is present; else false
public flForm
# addToGroup( string $element, flFormElement $name )

Add element to an existing group.

Add element to an existing group.

Parameters

$element
$name The name of the group.
$name
$element The element to put in the group.

Returns

flForm
This object.

Throws

flFormException
public flForm
# addTab( string $label, array $groups )

Add a tab containing the specified groups.

Add a tab containing the specified groups.

Parameters

$label
The label for the tab.
$groups
Array of groups names to add to the tab, or single group name.

Returns

flForm
This object.
public flFrom
# setGroupLabel( string $name, string $label )

Set the label for a group.

Set the label for a group.

Parameters

$name
The name of the group to set the label for or null for the default.
$label
The HTML formatted label for the group.

Returns

flFrom
This object
public boolean
# isSubmitted( )

Get if the form has been submitted.

Get if the form has been submitted.

If an AJAX validation request is detected then the response is sent back and the function never returns.

Returns

boolean
true if the form has been submitted else false.
public boolean
# isValid( )

Test if the form and its elements are valid.

Test if the form and its elements are valid.

Returns

boolean

true if the form and its elements are valid; else false. true is also returned if isSubmitted() returns false.

public boolean
# isInvalidated( )

Test if the form has been invalidated by one of the elements changing state from valid to invalid.

Test if the form has been invalidated by one of the elements changing state from valid to invalid.

Returns

boolean
true if the form has been invalidated; else false.
public
# setAJAXWaitText( string $text )

Set the text to use for AJAX waiting messages.

Set the text to use for AJAX waiting messages.

Parameters

$text
The text to show.
public
# setAJAXFailText( string $text )

Set the text to use for the AJAX failed message.

Set the text to use for the AJAX failed message.

Parameters

$text
The text to show.
public
# setOnSubmitJS( string $js )

Set the JavaScript to run on form submit, if the function returns false then the form is not submitted.

Set the JavaScript to run on form submit, if the function returns false then the form is not submitted.

Parameters

$js
The JavaScript to run on form submit.
public
# focusElement( flFormElement $elem )

The element to set focus to.

The element to set focus to.

Parameters

$elem
The element to focus by default.
public string
# getFormTagAttr( )

Get the form tag attributes, used by decorators to open the form.

Get the form tag attributes, used by decorators to open the form.

Returns

string
The form open tag.
public
# setCSS( string $class )

Set the CSS class for the form.

Set the CSS class for the form.

Parameters

$class
The class name of null for no class.
public
# showOnlyErrors( boolean $showOnlyErrors = true )

Flags if to only show validation errors rather than also showing a message for valid fields.

Flags if to only show validation errors rather than also showing a message for valid fields.

Parameters

$showOnlyErrors
true, the default, shows only errors or false to show errors and valid fields.
public boolean
# getShowOnlyErrors( )

Get if showing only errors on validation.

Get if showing only errors on validation.

Returns

boolean
true if showing only errors; else false.
public flRequest
# getRequest( )

Get the forms request object.

Get the forms request object.

Returns

flRequest
The request object.
public
# setRequiredText( string $required )

Set the decoration to apply to required elements, default is '(Required)'.

Set the decoration to apply to required elements, default is '(Required)'.

Parameters

$required
The decoration text.
public string
# getRequiredText( )

Get the decoration to apply to required elements.

Get the decoration to apply to required elements.

Returns

string
The required text.
public
# setValidText( string $text )

Set the text to return with getError() for valid elements.

Set the text to return with getError() for valid elements.

Parameters

$text
The text to set.
public string
# getValidText( )

Get the text for valid elements.

Get the text for valid elements.

Returns

string
The valid string.
public flBufferCode
# getCodeBuffer( )

Get the code buffer being used during rendering.

Get the code buffer being used during rendering.

Returns

flBufferCode
The code buffer if any.
public string
# render( flBufferCode $codeBuffer = null )

Render the form.

Render the form.

If an AJAX validation request is detected then it is replied to and the function never returns.

Parameters

$codeBuffer
The optional code buffer helper if not given then JavaScript is put inline.

Returns

string
The HTML for the form.

See

flForm::isSubmitted()
public string
# getName( )

Get the form name.

Get the form name.

Returns

string
The name of the form.
clearFusionCMS 3.0.0 API documentation generated by ApiGen