Overview

Packages

  • Actions
  • Codegen
  • Controls
    • Base
  • DatabaseAdapters
  • Events
  • None
  • Sessions
  • Tests

Classes

  • AbstractControl_CodeGenerator
  • AjaxTimingForm
  • BBCodeParser
  • CalculatorForm
  • ComplexColumn
  • Event
  • ExampleForm
  • Examples
  • ExampleService
  • ExamplesForm
  • HtmlJqDoc
  • InjectForm
  • JavaScriptHelper
  • JqAttributes
  • JqDoc
  • JqIcon
  • Method
  • MyControl
  • MyQSlider_ChangeEvent
  • NavPanel
  • Option
  • Order
  • Project
  • ProjectPickerListBox
  • QAbstractCacheProvider
  • QAbstractHtmlTableColumn
  • QAbstractHtmlTableDataColumn
  • QAccordion_ActivateEvent
  • QAccordion_BeforeActivateEvent
  • QAccordion_CreateEvent
  • QAjaxResponse
  • QApplication
  • QApplicationBase
  • QArchive
  • QAutocomplete_ChangeEvent
  • QAutocomplete_CloseEvent
  • QAutocomplete_CodeGenerator
  • QAutocomplete_CreateEvent
  • QAutocomplete_FocusEvent
  • QAutocomplete_OpenEvent
  • QAutocomplete_ResponseEvent
  • QAutocomplete_SearchEvent
  • QAutocomplete_SelectEvent
  • QAutocomplete_SourceEvent
  • QAutocompleteBase_CodeGenerator
  • QAutocompleteListItem
  • QBaseClass
  • QBorderCollapse
  • QBorderStyle
  • QBrowserType
  • QCache
  • QCacheDeleteAction
  • QCacheDeleteAllAction
  • QCacheProviderAPC
  • QCacheProviderLocalMemory
  • QCacheProviderMemcache
  • QCacheProviderNoCache
  • QCacheProviderProxy
  • QCacheSetAction
  • QCalendarType
  • QCallType
  • QCausesValidation
  • QCheckBox_CodeGenerator
  • QCheckBoxBase_CodeGenerator
  • QCheckBoxList_CodeGenerator
  • QCheckBoxListBase_CodeGenerator
  • QControl_CodeGenerator
  • QControlBase_CodeGenerator
  • QControlCategoryType
  • QControlProxy
  • QCrossScripting
  • QCryptography
  • QCss
  • QCursor
  • QDatabaseFieldBase
  • QDatabaseResultBase
  • QDataGrid_CodeGenerator
  • QDataGridBase_CodeGenerator
  • QDatepicker_BeforeShowDayEvent
  • QDatepicker_BeforeShowEvent
  • QDatepicker_CalculateWeekEvent
  • QDatepicker_ChangeMonthYearEvent
  • QDatepicker_CloseEvent
  • QDatepicker_SelectEvent
  • QDatepicker_SelectEvent2
  • QDatepickerBox_BeforeShowDayEvent
  • QDatepickerBox_BeforeShowEvent
  • QDatepickerBox_CalculateWeekEvent
  • QDatepickerBox_ChangeMonthYearEvent
  • QDatepickerBox_CloseEvent
  • QDatepickerBox_CodeGenerator
  • QDatepickerBox_SelectEvent
  • QDatepickerBoxBase_CodeGenerator
  • QDateTime
  • QDateTimePicker_CodeGenerator
  • QDateTimePickerBase_CodeGenerator
  • QDateTimePickerFormat
  • QDateTimePickerType
  • QDateTimeSpan
  • QDbBackedFormStateHandler
  • QDialog_BeforeCloseEvent
  • QDialog_ButtonEvent
  • QDialog_CloseEvent
  • QDialog_CreateEvent
  • QDialog_DragEvent
  • QDialog_DragStartEvent
  • QDialog_DragStopEvent
  • QDialog_FocusEvent
  • QDialog_OpenEvent
  • QDialog_ResizeEvent
  • QDialog_ResizeStartEvent
  • QDialog_ResizeStopEvent
  • QDisplayStyle
  • QDraggable_CreateEvent
  • QDraggable_DragEvent
  • QDraggable_StartEvent
  • QDraggable_StopEvent
  • QDroppable_ActivateEvent
  • QDroppable_CreateEvent
  • QDroppable_DeactivateEvent
  • QDroppable_DropEvent
  • QDroppable_OutEvent
  • QDroppable_OverEvent
  • QEmailAttachment
  • QEmailMessage
  • QEmailServer
  • QEmailStringAttachment
  • QErrorAttribute
  • QFile
  • QFileAssetType
  • QFileFormStateHandler
  • QFloatTextBox_CodeGenerator
  • QFloatTextBoxBase_CodeGenerator
  • QFolder
  • QFormGen
  • QFormStateHandler
  • QGridLines
  • QHListControl
  • QHorizontalAlign
  • QHtml
  • QHtmlReporter
  • QHtmlTable_CodeGenerator
  • QHtmlTableCallableColumn
  • QHtmlTableCheckBoxColumn
  • QHtmlTableCheckBoxColumn_ClickEvent
  • QHtmlTableIndexedColumn
  • QHtmlTableLinkColumn
  • QHtmlTableNodeColumn
  • QHtmlTablePropertyColumn
  • QI18n
  • QImageType
  • QInformixPdoDatabaseField
  • QInformixPdoDatabaseResult
  • QInformixPdoDatabaseRow
  • QInstallationValidationResult
  • QInstallationValidator
  • QIntegerTextBox_CodeGenerator
  • QIntegerTextBoxBase_CodeGenerator
  • QJqButton_CreateEvent
  • QJqCheckBox_CreateEvent
  • QJqRadioButton_CreateEvent
  • QJsClosure
  • QJsFunction
  • QJsNoQuoteKey
  • QJsParameterList
  • QJsPriority
  • QJsVarName
  • QLabel_CodeGenerator
  • QLabelBase_CodeGenerator
  • QLexer
  • QListBox_CodeGenerator
  • QListBoxBase_CodeGenerator
  • QListControl_CodeGenerator
  • QListControlBase_CodeGenerator
  • QMenu
  • QMenu_BlurEvent
  • QMenu_CreateEvent
  • QMenu_FocusEvent
  • QMenu_SelectEvent
  • QMimeType
  • QModelConnectorArgumentType
  • QModelConnectorCreateType
  • QModelConnectorEditDlg
  • QModelConnectorOptions
  • QModelConnectorParam
  • QMultiLevelCacheProvider
  • QMySqlDatabaseResult
  • QNoScriptAjaxAction
  • QOracleDatabaseField
  • QOracleDatabaseResult
  • QOrderedListType
  • QOverflow
  • QPartialQueryBuilder
  • QPdoDatabaseResult
  • QPgConditionILike
  • QPgConditionJsonContains
  • QPgQ
  • QPosition
  • QPostgreSqlPdoDatabaseField
  • QPostgreSqlPdoDatabaseResult
  • QPostgreSqlPdoDatabaseRow
  • QProgressbar_ChangeEvent
  • QProgressbar_CompleteEvent
  • QProgressbar_CreateEvent
  • QQ
  • QQAggregationClause
  • QQAssociationNode
  • QQAverage
  • QQClause
  • QQColumnNode
  • QQCondition
  • QQConditionAll
  • QQConditionAnd
  • QQConditionBetween
  • QQConditionComparison
  • QQConditionEqual
  • QQConditionExists
  • QQConditionGreaterOrEqual
  • QQConditionGreaterThan
  • QQConditionIn
  • QQConditionIsNotNull
  • QQConditionIsNull
  • QQConditionLessOrEqual
  • QQConditionLessThan
  • QQConditionLike
  • QQConditionLogical
  • QQConditionNone
  • QQConditionNot
  • QQConditionNotBetween
  • QQConditionNotEqual
  • QQConditionNotExists
  • QQConditionNotIn
  • QQConditionNotLike
  • QQConditionOr
  • QQCount
  • QQDistinct
  • QQExpand
  • QQExpandAsArray
  • QQExpandVirtualNode
  • QQFunctionNode
  • QQGroupBy
  • QQHavingClause
  • QQLimitInfo
  • QQMathNode
  • QQMaximum
  • QQMinimum
  • QQNamedValue
  • QQNode
  • QQNoParentNode
  • QQOrderBy
  • QQReverseReferenceNode
  • QQSelect
  • QQSubQueryCountNode
  • QQSubQueryNode
  • QQSubQuerySqlNode
  • QQSum
  • QQTableNode
  • QQuery
  • QQueryBuilder
  • QQueryExpansion
  • QQVirtualNode
  • QRadioButtonList_CodeGenerator
  • QRadioButtonListBase_CodeGenerator
  • QRegex
  • QRepeatDirection
  • QRequestMode
  • QResizable_CreateEvent
  • QResizable_ResizeEvent
  • QResizable_StartEvent
  • QResizable_StopEvent
  • QResizeHandleDirection
  • QRssCategory
  • QRssFeed
  • QRssImage
  • QRssItem
  • QSampleTranslation
  • QSelectable_CreateEvent
  • QSelectable_SelectedEvent
  • QSelectable_SelectingEvent
  • QSelectable_StartEvent
  • QSelectable_StopEvent
  • QSelectable_UnselectedEvent
  • QSelectable_UnselectingEvent
  • QSelectionMode
  • QSelectMenu_ChangeEvent
  • QSelectMenu_CloseEvent
  • QSelectMenu_CreateEvent
  • QSelectMenu_FocusEvent
  • QSelectMenu_OpenEvent
  • QSelectMenu_SelectEvent
  • QSessionFormStateHandler
  • QSlider_ChangeEvent
  • QSlider_CodeGenerator
  • QSlider_CreateEvent
  • QSlider_SlideEvent
  • QSlider_StartEvent
  • QSlider_StopEvent
  • QSliderBase_CodeGenerator
  • QSoapMethod
  • QSoapParameter
  • QSoapService
  • QSortable_ActivateEvent
  • QSortable_BeforeStopEvent
  • QSortable_ChangeEvent
  • QSortable_CreateEvent
  • QSortable_DeactivateEvent
  • QSortable_OutEvent
  • QSortable_OverEvent
  • QSortable_ReceiveEvent
  • QSortable_RemoveEvent
  • QSortable_SortEvent
  • QSortable_StartEvent
  • QSortable_StopEvent
  • QSortable_UpdateEvent
  • QSpinner
  • QSpinner_ChangeEvent
  • QSpinner_CreateEvent
  • QSpinner_SpinEvent
  • QSpinner_StartEvent
  • QSpinner_StopEvent
  • QSqLite3PdoDatabaseField
  • QSqLite3PdoDatabaseResult
  • QSqLite3PdoDatabaseRow
  • QStack
  • QString
  • QTabs_ActivateEvent
  • QTabs_BeforeActivateEvent
  • QTabs_BeforeLoadEvent
  • QTabs_CreateEvent
  • QTabs_LoadEvent
  • QTag
  • QTestForm
  • QTextAlign
  • QTextBox_CodeGenerator
  • QTextBoxBase_CodeGenerator
  • QTextMode
  • QTimer
  • QTranslationPoParser
  • QType
  • QUnorderedListStyle
  • QVerticalAlign
  • QVirtualAttributeColumn
  • QWatcher
  • QWatcherBase
  • QWatcherCache
  • QWatcherDB
  • QWatcherNone
  • SampleComposite
  • SelectForm

Interfaces

  • ICacheAction
  • QDataList_CodeGenerator_Interface
  • QTranslationBase

Traits

  • QDataBinder
  • QModelTrait

Exceptions

  • QCallerException
  • QCryptographyException
  • QDataBindException
  • QDateTimeNullException
  • QEmailException
  • QIndexOutOfRangeException
  • QInformixPdoDatabaseException
  • QInvalidCastException
  • QInvalidFormStateException
  • QOptimisticLockingException
  • QPdoDatabaseException
  • QPoParserException
  • QPostgreSqlPdoDatabaseException
  • QRemoteAdminDeniedException
  • QSqLite3PdoDatabaseException
  • QUndefinedMethodException
  • QUndefinedPrimaryKeyException
  • QUndefinedPropertyException

Functions

  • __database_check_error
  • _b
  • _indent
  • _nl
  • _p
  • _r
  • _t
  • _tp
  • _tr
  • array_trim
  • beginsWith
  • CamelCaseFromDash
  • CastToInt
  • DisplayMonospacedText
  • endsWith
  • GO_BACK
  • jq_anytime_gen
  • jq_control_gen
  • jq_inc_gen
  • jq_indent
  • PrintExplainStatement
  • PrintInstructions
  • QcubedHandleCodeGenParseError
  • QcubedHandleError
  • QcubedHandleException
  • QCubedShutdown
  • QDateTimeErrorHandler
  • trimOffEnd
  • trimOffFront
  • Overview
  • Package
  • Class

Class QHtml

An abstract utility class to handle Html tag rendering, as well as utilities to render pieces of HTML and CSS code. All methods are static.

Abstract
Located at includes/framework/QHtml.class.php
Methods summary
final public QHtml
# __construct( )

This faux constructor method throws a caller exception. The Css object should never be instantiated, and this constructor override simply guarantees it.

This faux constructor method throws a caller exception. The Css object should never be instantiated, and this constructor override simply guarantees it.

Returns

QHtml

Throws

QCallerException
public static string
# RenderTag( string $strTag, null|mixed $mixAttributes, null|string $strInnerHtml = null, boolean $blnIsVoidElement = false, boolean $blnNoSpace = false )

Renders an html tag with the given attributes and inner html.

Renders an html tag with the given attributes and inner html.

If the innerHtml is detected as being wrapped in an html tag of some sort, it will attempt to format the code so that it has a structured view in a browser, with the inner html indented and on a new line in between the tags. You can turn this off by setting MINIMIZE, or by passing in true to $blnNoSpace.

There area a few special cases to consider: - Void elements will not be formatted to avoid adding unnecessary white space since these are generally inline elements - Non-void elements always use internal newlines, even in MINIMIZE mode. This is to prevent different behavior from appearing in MINIMIZE mode on inline elements, because inline elements with internal space will render with space to separate from surrounding elements. Usually, this is not an issue, but in the special situations where you really need inline elements to be right up against its siblings, set $blnNoSpace to true.

Parameters

$strTag
The tag name
$mixAttributes
String of attribute values or array of attribute values.
$strInnerHtml
The html to print between the opening and closing tags. This will NOT be escaped.
$blnIsVoidElement
True to print as a tag with no closing tag.
$blnNoSpace
Renders with no white-space. Useful in special inline situations.

Returns

string
The rendered html tag
public static string
# RenderLabeledInput( $strLabel, $blnTextLeft, $strAttributes, $strLabelAttributes, $blnWrapped )

Renders an input element with a label tag. Uses separate styling for the label and the input object. In particular, this gives you the option of wrapping the input with a label (which is what Bootstrap expects on checkboxes) or putting the label next to the object (which is what jQueryUI expects).

Renders an input element with a label tag. Uses separate styling for the label and the input object. In particular, this gives you the option of wrapping the input with a label (which is what Bootstrap expects on checkboxes) or putting the label next to the object (which is what jQueryUI expects).

Note that if you are not setting $blnWrapped, it is up to you to insert the "for" attribute into the label attributes.

Parameters

$strLabel
$blnTextLeft
$strAttributes
$strLabelAttributes
$blnWrapped

Returns

string
final public static string
# FormatLength( string $strValue )

Returns the formatted value of type . See http://www.w3.org/TR/CSS1/#units for more info.

Returns the formatted value of type . See http://www.w3.org/TR/CSS1/#units for more info.

Parameters

$strValue
The number or string to be formatted to the compatible value.

Returns

string
the formatted value of type .
public static boolean
# SetLength( string & $strOldLength, string $newLength )

Sets the given length string to the new length value. If the new length is preceded by a math operator (+-/*), then arithmetic is performed on the previous value. Returns true if the length changed.

Sets the given length string to the new length value. If the new length is preceded by a math operator (+-/*), then arithmetic is performed on the previous value. Returns true if the length changed.

Parameters

$strOldLength
$newLength

Returns

boolean
true if the length was changed
public static boolean
# AddClass( string & $strClassList, string $strNewClasses )

Helper to add a class or classes to a pre-existing space-separated list of classes. Checks to make sure the class isn't already in the list. Returns true to indicate a change in the list.

Helper to add a class or classes to a pre-existing space-separated list of classes. Checks to make sure the class isn't already in the list. Returns true to indicate a change in the list.

Parameters

$strClassList
Current list of classes separated by a space
$strNewClasses
New class to add. Could be a list separated by spaces.

Returns

boolean
true if the class list was changed.
public static boolean
# RemoveClass( string & $strClassList, string $strCssNamesToRemove )

Helper to remove a class or classes from a list of space-separated classes.

Helper to remove a class or classes from a list of space-separated classes.

Parameters

$strClassList
class list string to search
$strCssNamesToRemove
space separated list of names to remove

Returns

boolean
true if the class list was changed
public static boolean
# RemoveClassesByPrefix( & $strClassList, $strPrefix )

Many CSS frameworks use families of classes, which are built up from a base family name. For example, Bootstrap uses 'col-lg-6' to represent a column that is 6 units wide on large screens and Foundation uses 'large-6' to do the same thing. This utility removes classes that start with a particular prefix to remove whatever sizing class was specified.

Many CSS frameworks use families of classes, which are built up from a base family name. For example, Bootstrap uses 'col-lg-6' to represent a column that is 6 units wide on large screens and Foundation uses 'large-6' to do the same thing. This utility removes classes that start with a particular prefix to remove whatever sizing class was specified.

Parameters

$strClassList
$strPrefix

Returns

boolean
true if the class list changed
public static string
# RenderHtmlAttributes( array|null $attributes )

Render the given attribute array for html output. Escapes html entities enclosed in values. Uses double-quotes to surround the value. Precedes the resulting text with a space character.

Render the given attribute array for html output. Escapes html entities enclosed in values. Uses double-quotes to surround the value. Precedes the resulting text with a space character.

Parameters

$attributes

Returns

string
public static string
# RenderStyles( array $styles )

Render the given array as a css style string. It will NOT be escaped.

Render the given array as a css style string. It will NOT be escaped.

Parameters

$styles
key/value array representing the styles.

Returns

string
a string suitable for including in a css 'style' property
public static string
# Comment( string $strText, boolean $blnRemoveOnMinimize = true )

Returns the given string formatted as an html comment that will go on its own line.

Returns the given string formatted as an html comment that will go on its own line.

Parameters

$strText
$blnRemoveOnMinimize

Returns

string
public static string
# MakeUrl( string $strLocation, array|null $queryParams = null, string|null $strAnchor = null, string|null $strProtocol = null, string|null $strServer = null, string|null $strUser = null, string|null $strPassword = null, string|null $intPort = null )

Generate a URL from components. This URL can be used in the QApplication::Redirect function, or applied to an anchor tag by setting the href attribute.

Generate a URL from components. This URL can be used in the QApplication::Redirect function, or applied to an anchor tag by setting the href attribute.

Parameters

$strLocation
absolute or relative path to resource, depending on your protocol. If not needed, enter an empty string.
$queryParams
key->value array of query parameters to add to the location.
$strAnchor
anchor to add to the url
$strProtocol
protocol if specifying a resource outside of the current server
$strServer
server that the resource is on. Required if specifying a protocol.
$strUser
user name if needed. Some protocols like mailto and ftp need this
$strPassword
password if needed. Note that password is sent in the clear.
$intPort
port if different from default

Returns

string
public static string
# MailToUrl( $strUser, $strServer, null $queryParams = null )

Returns a MailTo url.

Returns a MailTo url.

Parameters

$strUser
$strServer
$queryParams

Returns

string
public static
# RenderLink( string $strUrl, string $strText, array $attributes = null, boolean $blnHtmlEntities = true )

Utility function to create a link, i.e. an "a" tag.

Utility function to create a link, i.e. an "a" tag.

Parameters

$strUrl
URL to link to. Use MakeUrl or MailToUrl to create the URL.
$strText
The inner text. This WILL be escaped.
$attributes
Other html attributes to include in the tag
$blnHtmlEntities
False to prevent encoding
public static
# RenderString( $strText )

Renders a PHP string as HTML text. Makes sure special characters are encoded, and
tags are substituted for newlines.

Renders a PHP string as HTML text. Makes sure special characters are encoded, and
tags are substituted for newlines.

Parameters

$strText
Constants summary
boolean IsVoid
# true
string HTTP

HTTP Protocol

HTTP Protocol

# 'http://'
string HTTPS

HTTPS Protocol

HTTPS Protocol

# 'https://'
string FTP

FTP Protocol

FTP Protocol

# 'ftp://'
string SFTP

SFTP Protocol

SFTP Protocol

# 'sftp://'
string SMB

SMB Protocol

SMB Protocol

# 'smb://'
API documentation generated by ApiGen