SilverStripe 3.0 API Docs
  • Package
  • Class
  • Tree
  • Deprecated
Version: master
  • master
  • 3.1
  • 3.0
  • 2.4
  • tagfield

Packages

  • cms
    • assets
    • batchaction
    • batchactions
    • content
    • control
    • controller
    • controllers
    • core
    • export
    • filesystem
    • forms
    • model
    • publishers
    • reports
    • search
    • security
    • tasks
  • forms
    • actions
    • core
    • fields-basic
    • fields-dataless
    • fields-datetime
    • fields-files
    • fields-formattedinput
    • fields-relational
    • fields-structural
    • transformations
    • validators
  • framework
    • admin
    • bulkloading
    • control
    • core
    • cron
    • dev
    • email
    • fields-formattedinput
    • fields-relational
    • filesystem
    • formatters
    • forms
    • gridfield
    • i18n
    • injector
    • integration
    • manifest
    • misc
    • model
    • parsers
    • search
    • security
    • tasks
    • testing
    • validation
    • view
  • None
  • PHP

Classes

  • DatalessField
  • HeaderField
  • HiddenField
  • LabelField
  • LiteralField
  • ToggleField

Class LiteralField

This field lets you put an arbitrary piece of HTML into your forms.

Usage

new LiteralField (
   $name = "literalfield",
   $content = '<b>some bold text</b> and <a href="http://silverstripe.com">a link</a>'
)
Object
Extended by ViewableData implements IteratorAggregate
Extended by RequestHandler
Extended by FormField
Extended by DatalessField
Extended by LiteralField
Package: forms\fields-dataless
Located at sapphire/forms/LiteralField.php

Methods summary

public
# __construct( FormField::$name $name, FormField::$title $content )

Create a new field.

Create a new field.

Parameters

$name
FormField::$name
The internal field name, passed to forms.
$content
FormField::$title
The field label.

Overrides

FormField::__construct
public string
# FieldHolder( array $properties = array() )

Returns the field's representation in the form. For dataless fields, this defaults to $Field.

Returns the field's representation in the form. For dataless fields, this defaults to $Field.

Parameters

$properties
array
$properties key value pairs of template variables

Returns

string

Overrides

DatalessField::FieldHolder
public string
# Field( array $properties = array() )

Returns the form field - used by templates. Although FieldHolder is generally what is inserted into templates, all of the field holder templates make use of $Field. It's expected that FieldHolder will give you the "complete" representation of the field on the form, whereas Field will give you the core editing widget, such as an input tag.

Returns the form field - used by templates. Although FieldHolder is generally what is inserted into templates, all of the field holder templates make use of $Field. It's expected that FieldHolder will give you the "complete" representation of the field on the form, whereas Field will give you the core editing widget, such as an input tag.

Parameters

$properties
array
$properties key value pairs of template variables

Returns

string

Overrides

FormField::Field
public
# setContent( string $content )

Sets the content of this field to a new value

Sets the content of this field to a new value

Parameters

$content
string
$content
public string
# getContent( )

Returns

string
public
# setValue( mixed $value )

Synonym of LiteralField::setContent() so that LiteralField is more compatible with other field types.

Synonym of LiteralField::setContent() so that LiteralField is more compatible with other field types.

Overrides

FormField::setValue
public
# performReadonlyTransformation( )

Returns a readonly version of this field

Returns a readonly version of this field

Overrides

DatalessField::performReadonlyTransformation

Methods inherited from DatalessField

SmallFieldHolder(), Type(), getAllowHTML(), getAttributes(), hasData(), setAllowHTML()

Methods inherited from FormField

ID(), LeftTitle(), Link(), Message(), MessageType(), Name(), Required(), RightTitle(), Title(), Value(), addExtraClass(), attrTitle(), attrValue(), createTag(), dataValue(), debug(), describe(), extraClass(), forTemplate(), getAttribute(), getAttributesHTML(), getCustomValidationMessage(), getDescription(), getFieldHolderTemplate(), getFieldHolderTemplates(), getForm(), getName(), getSmallFieldHolderTemplate(), getSmallFieldHolderTemplates(), getTabIndex(), getTemplate(), getTemplates(), hasClass(), isComposite(), isDisabled(), isReadonly(), name_to_label(), performDisabledTransformation(), removeExtraClass(), rootFieldList(), rootFieldSet(), saveInto(), securityTokenEnabled(), setAttribute(), setContainerFieldList(), setContainerFieldSet(), setCustomValidationMessage(), setDescription(), setDisabled(), setError(), setFieldHolderTemplate(), setForm(), setLeftTitle(), setName(), setReadonly(), setRightTitle(), setSmallFieldHolderTemplate(), setTabIndex(), setTemplate(), setTitle(), transform(), validate()

Methods inherited from RequestHandler

allowedActions(), checkAccessAction(), getRequest(), handleRequest(), hasAction(), httpError(), isAjax(), setDataModel(), setRequest()

Methods inherited from ViewableData

ATT_val(), CSSClasses(), Debug(), JS_val(), Me(), RAW_val(), SQL_val(), ThemeDir(), XML_val(), __get(), __isset(), __set(), buildCastingCache(), cachedCall(), castingClass(), castingHelper(), castingHelperPair(), castingObjectCreator(), castingObjectCreatorPair(), customise(), defineMethods(), escapeTypeForField(), getField(), getIterator(), getXMLValues(), hasField(), hasValue(), obj(), renderWith(), setCustomisedObj(), setField()

Methods inherited from Object

__call(), __toString(), addMethodsFrom(), addStaticVars(), addWrapperMethod(), add_extension(), add_static_var(), allMethodNames(), cacheToFile(), clearCache(), combined_static(), config(), create(), createMethod(), create_from_string(), exists(), extend(), getCustomClass(), getExtensionInstance(), getExtensionInstances(), get_extensions(), get_extra_config_sources(), get_static(), hasExtension(), hasMethod(), has_extension(), invokeWithExtensions(), is_a(), loadCache(), parentClass(), parse_class_spec(), remove_extension(), sanitiseCachename(), saveCache(), set_stat(), set_static(), set_uninherited(), stat(), static_lookup(), strong_create(), uninherited(), uninherited_static(), useCustomClass()

Magic methods summary

Properties summary

protected string $content
#

$content

$content

Properties inherited from DatalessField

$allowHTML

Properties inherited from FormField

$attributes, $containerFieldList, $customValidationMessage, $description, $disabled, $dontEscape, $extraClass, $extraClasses, $fieldHolderTemplate, $form, $leftTitle, $message, $messageType, $name, $readonly, $rightTitle, $smallFieldHolderTemplate, $template, $title, $value

Properties inherited from RequestHandler

$allowed_actions, $brokenOnConstruct, $model, $request, $url_handlers

Properties inherited from ViewableData

$casting, $customisedObject, $default_cast, $failover

Properties inherited from Object

$class, $extension_instances, $extensions

Comments

Comment policy: Please use comments for tips and corrections about the described functionality. Comments are moderated, we reserve the right to remove comments that are inappropriate or are no longer relevant.
Use the Silverstripe Forum to ask questions.
blog comments powered by Disqus
SilverStripe 3.0 API Docs API documentation generated by ApiGen 2.8.0