FRED™  3.0
FRED™: Framework for Rapid and Easy Development
Html Class Reference
Inheritance diagram for Html:
View Component Thing

Public Member Functions

 addStyle ($style, $id=null)
 
 addStyleSrc ($source, $id=null, $options=null)
 
 addScript ($script, $id=null)
 
 addScriptInit ($script, $id=null)
 
 addScriptSrc ($source, $id=null, $options=null)
 
 minifyFiles ($type, $sources, $target=null, $id=null, $options=null)
 
 minifyScripts ($sources, $target=null, $id=null, $options=null)
 
 minifyStyles ($sources, $target=null, $id=null, $options=null)
 
 head ()
 
 script ()
 
 createWidget ($id, $widget)
 Create a view widget. More...
 
 widget ($id)
 
 notRenderedWidgetIds ($ids=null)
 
 renderWidget ($id)
 
 render ()
 
- Public Member Functions inherited from View
 jsonEncode ($data)
 
 render ()
 
- Public Member Functions inherited from Component
 __construct ($fred, $config=null)
 
 __destruct ()
 
 clientConfig ()
 Public configuration. More...
 
 config ($key, $default=null)
 Retrieve a config value. More...
 
 ping ()
 Ping function. More...
 
 filemtime ($filename)
 Filemtime with session cache. More...
 
 component ($name)
 Get a component (local or default). More...
 
 components (... $names)
 Get multiple components in an array. More...
 
- Public Member Functions inherited from Thing
 propertyExists ($property)
 Check if a property exists (public or published). More...
 
 constants ($prefix=null)
 Return all constants. More...
 
 get ($key)
 Get one or more properties. More...
 
 set ($key, $value=null)
 Set one or more properties. More...
 
 __get ($key)
 
 __set ($key, $value)
 

Data Fields

const RESOURCE_NO_PUSH = 1
 Do not add a push header for the resource. More...
 
const RESOURCE_PROXY = 2
 Serve the resource through the proxy component. More...
 
const RESOURCE_ASYNC = 4
 Serve the resource with the asynchronous attribute. More...
 
const RESOURCE_DEFER = 8
 Serve the resource with the deferred attribute. More...
 
 $convert = true
 
 $debugMinifyProbability = 4
 Chance (1 in x) for using minified file in debug mode. More...
 
 $asyncPrefix = '@'
 Resource ID prefix to indicate asynchronous loading. More...
 
 $deferPrefix = '$'
 Resource ID prefix to indicate deferred loading. More...
 
 $integrityAlgo = 'sha256'
 Hashing algorithm to use for subresource integrity (empty = do not use). More...
 
 $widgetClassNames = []
 View widget class name (value) per widget class name (key). More...
 
 $defaultWidgetNamespace = __CLASS__ . '\\Widget'
 
 $defaultWidgetClassName = __CLASS__ . '\\Widget'
 
 $renderedWidgetIds = []
 
 $builderClassNames = [null => __CLASS__ . '\\Builder']
 Default builder class name per client type (null =. More...
 
 $actionCaptionPrefix = 'action'
 Prefix to prepend to the action name to get a translation ID. More...
 
 $defaultTemplatePath = null
 
 $formClass = 'fred'
 
 $formInvalidMessage = null
 
- Data Fields inherited from View
 $convert = false
 
 $minifiedPath = null
 
 $numericCheck = false
 Convert numeric strings to numbers. More...
 
 $maxInt = 0x7fffffff
 Higher numbers (integers) will not be converted (from string). More...
 
- Data Fields inherited from Component
 $filemtimeTtl = 0
 
- Data Fields inherited from Thing
const HIDDEN = 0
 Property is hidden. More...
 
const READABLE = 1
 Property is readable. More...
 
const WRITEABLE = 2
 Property is writeable. More...
 
const READWRITE = 3
 Property is readable and writeable. More...
 

Protected Member Functions

 init ()
 
 addResource (&$resource, $id, $value, $options=null)
 
 integrity ($resource, $hash=null)
 
 renderWidgets ($ids=null, $builder=null)
 Render the widgets. More...
 
 renderFormAction ($action)
 
 renderFormActions ()
 
 renderForm ($content=null)
 Render the form. More...
 
 getMobile ()
 
- Protected Member Functions inherited from View
 init ()
 
 getData ()
 
- Protected Member Functions inherited from Component
 init ()
 
 done ()
 
 getSession ()
 
- Protected Member Functions inherited from Thing
 publish ($property, $visibility=self::READABLE)
 Publish a property (or hide it again). More...
 
 configure ($config)
 Configure the object. More...
 
 _get ($key)
 Default getter if no specific setter is defined, and the property is also not published (readable). More...
 
 _set ($key, $value)
 Default setter if no specific setter is defined, and the property is also not published (writeable). More...
 

Protected Attributes

 $_integrityCacheFile = null
 
 $_integrityHashes = null
 
 $_style = []
 
 $_styleSrc = []
 
 $_script = []
 
 $_scriptInit = []
 
 $_scriptSrc = []
 
 $_noPush = []
 
 $_widgets = []
 
 $_template = null
 
- Protected Attributes inherited from View
 $_title = null
 
 $_controller = null
 
- Protected Attributes inherited from Component
 $_fred = null
 
 $_config = null
 
 $_name = null
 
 $_components = []
 Local components (key = component name, value = component). More...
 
 $_session = null
 
- Protected Attributes inherited from Thing
 $_published = []
 Published properties (key = name of property, value = visibility). More...
 

Detailed Description

Definition at line 5 of file Html.php.

Member Function Documentation

◆ addResource()

addResource ( $resource,
  $id,
  $value,
  $options = null 
)
protected

Definition at line 46 of file Html.php.

◆ addScript()

addScript (   $script,
  $id = null 
)

Definition at line 63 of file Html.php.

◆ addScriptInit()

addScriptInit (   $script,
  $id = null 
)

Definition at line 67 of file Html.php.

◆ addScriptSrc()

addScriptSrc (   $source,
  $id = null,
  $options = null 
)

Definition at line 71 of file Html.php.

◆ addStyle()

addStyle (   $style,
  $id = null 
)

Definition at line 55 of file Html.php.

◆ addStyleSrc()

addStyleSrc (   $source,
  $id = null,
  $options = null 
)

Definition at line 59 of file Html.php.

◆ createWidget()

createWidget (   $id,
  $widget 
)

Create a view widget.

First the complete model widget class name is looked up in the widgetClassNames. If not found this is retried with only the basename. If not found the basename is sought in the defaultWidgetNamespace, and the same goes for the client config class name (stripped from the default model widget namespace). If still no result, the defaultWidgetClassName is used.

Parameters
string$idWidget ID.
\\Rsi\\Fred\\Conroller\\Widget$widgetModel widget.
Returns
\Rsi\Fred\Controller\View\Html\Widget

Definition at line 174 of file Html.php.

◆ getMobile()

getMobile ( )
protected

Definition at line 259 of file Html.php.

◆ head()

head ( )

Definition at line 113 of file Html.php.

◆ init()

init ( )
protected

Definition at line 41 of file Html.php.

◆ integrity()

integrity (   $resource,
  $hash = null 
)
protected

Definition at line 75 of file Html.php.

◆ minifyFiles()

minifyFiles (   $type,
  $sources,
  $target = null,
  $id = null,
  $options = null 
)

Definition at line 94 of file Html.php.

◆ minifyScripts()

minifyScripts (   $sources,
  $target = null,
  $id = null,
  $options = null 
)

Definition at line 105 of file Html.php.

◆ minifyStyles()

minifyStyles (   $sources,
  $target = null,
  $id = null,
  $options = null 
)

Definition at line 109 of file Html.php.

◆ notRenderedWidgetIds()

notRenderedWidgetIds (   $ids = null)

Definition at line 192 of file Html.php.

◆ render()

render ( )

Definition at line 249 of file Html.php.

◆ renderForm()

renderForm (   $content = null)
protected

Render the form.

Parameters
string$contentThe content for the form (default = all widgets).
Returns
string HTML for the form.

Definition at line 244 of file Html.php.

◆ renderFormAction()

renderFormAction (   $action)
protected

Definition at line 227 of file Html.php.

◆ renderFormActions()

renderFormActions ( )
protected

Definition at line 234 of file Html.php.

◆ renderWidget()

renderWidget (   $id)

Definition at line 196 of file Html.php.

◆ renderWidgets()

renderWidgets (   $ids = null,
  $builder = null 
)
protected

Render the widgets.

Parameters
array$idsID's of the widgets to render (default = all not rendered yet).
Rsi\Fred\Controller\View\Html\Builder$builderBuilder to use (uses builderClassNames to create a new if empty).
Returns
string Rendered HTML.

Definition at line 215 of file Html.php.

◆ script()

script ( )

Definition at line 137 of file Html.php.

◆ widget()

widget (   $id)

Definition at line 187 of file Html.php.

Field Documentation

◆ $_integrityCacheFile

$_integrityCacheFile = null
protected

Definition at line 29 of file Html.php.

◆ $_integrityHashes

$_integrityHashes = null
protected

Definition at line 30 of file Html.php.

◆ $_noPush

$_noPush = []
protected

Definition at line 37 of file Html.php.

◆ $_script

$_script = []
protected

Definition at line 34 of file Html.php.

◆ $_scriptInit

$_scriptInit = []
protected

Definition at line 35 of file Html.php.

◆ $_scriptSrc

$_scriptSrc = []
protected

Definition at line 36 of file Html.php.

◆ $_style

$_style = []
protected

Definition at line 32 of file Html.php.

◆ $_styleSrc

$_styleSrc = []
protected

Definition at line 33 of file Html.php.

◆ $_template

$_template = null
protected

Definition at line 39 of file Html.php.

◆ $_widgets

$_widgets = []
protected

Definition at line 38 of file Html.php.

◆ $actionCaptionPrefix

$actionCaptionPrefix = 'action'

Prefix to prepend to the action name to get a translation ID.

Definition at line 24 of file Html.php.

◆ $asyncPrefix

$asyncPrefix = '@'

Resource ID prefix to indicate asynchronous loading.

Definition at line 15 of file Html.php.

◆ $builderClassNames

$builderClassNames = [null => __CLASS__ . '\\Builder']

Default builder class name per client type (null =.

Definition at line 22 of file Html.php.

◆ $convert

$convert = true

Definition at line 12 of file Html.php.

◆ $debugMinifyProbability

$debugMinifyProbability = 4

Chance (1 in x) for using minified file in debug mode.

Definition at line 14 of file Html.php.

◆ $defaultTemplatePath

$defaultTemplatePath = null

Definition at line 25 of file Html.php.

◆ $defaultWidgetClassName

$defaultWidgetClassName = __CLASS__ . '\\Widget'

Definition at line 20 of file Html.php.

◆ $defaultWidgetNamespace

$defaultWidgetNamespace = __CLASS__ . '\\Widget'

Definition at line 19 of file Html.php.

◆ $deferPrefix

$deferPrefix = '$'

Resource ID prefix to indicate deferred loading.

Definition at line 16 of file Html.php.

◆ $formClass

$formClass = 'fred'

Definition at line 26 of file Html.php.

◆ $formInvalidMessage

$formInvalidMessage = null

Definition at line 27 of file Html.php.

◆ $integrityAlgo

$integrityAlgo = 'sha256'

Hashing algorithm to use for subresource integrity (empty = do not use).

Definition at line 17 of file Html.php.

◆ $renderedWidgetIds

$renderedWidgetIds = []

Definition at line 21 of file Html.php.

◆ $widgetClassNames

$widgetClassNames = []

View widget class name (value) per widget class name (key).

Definition at line 18 of file Html.php.

◆ RESOURCE_ASYNC

const RESOURCE_ASYNC = 4

Serve the resource with the asynchronous attribute.

Definition at line 9 of file Html.php.

◆ RESOURCE_DEFER

const RESOURCE_DEFER = 8

Serve the resource with the deferred attribute.

Definition at line 10 of file Html.php.

◆ RESOURCE_NO_PUSH

const RESOURCE_NO_PUSH = 1

Do not add a push header for the resource.

Definition at line 7 of file Html.php.

◆ RESOURCE_PROXY

const RESOURCE_PROXY = 2

Serve the resource through the proxy component.

Definition at line 8 of file Html.php.


The documentation for this class was generated from the following file: