TextAreaConfig
class TextAreaConfig extends HTMLEditorConfig (View source)
An HTMLEditorConfig that allows using a textarea DOM element to directly edit HTML.
No client-side sanitisation of content is performed - it's all done server-side.
Traits
Provides extensions to this object to integrate it with standard config API methods.
A class that can be instantiated or replaced via DI
Config options
| default_config | string | Name of default config. This will be ignored if $current is assigned a value. | from HTMLEditorConfig | 
| default_config_definitions | array | Associative array of predefined HTMLEditorConfig definitions that can be accessed with the get() method. | from HTMLEditorConfig | 
| default_element_rules | Default set of rules to define which elements and attributes are allowed, and how to treat them. | from HTMLEditorConfig | |
| user_themes | array | List of themes defined for the frontend | from HTMLEditorConfig | 
| fixed_row_height | int | The height for the editable portion of editor in number of rows. | from HTMLEditorConfig | 
Properties
| protected static | HTMLEditorConfig[] | $configs | Array of registered configurations | from HTMLEditorConfig | 
| protected static | string | $current | Identifier key of current config. This will match an array key in $configs. | from HTMLEditorConfig | 
| protected static | array | $current_themes | List of the current themes set for this config | from HTMLEditorConfig | 
| protected static | string | $configType | ||
| protected static | string | $schemaComponent | 
Methods
Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .....).
Gets the uninherited value for the given config option
An implementation of the factory method, allows you to create an instance of a class
Creates a class instance by the "singleton" design pattern.
Get the HTMLEditorConfig object for the given identifier. This is a correct way to get an HTMLEditorConfig instance - do not call 'new'
Assign a new config, or clear existing, for the given identifier
Gets the current themes, if it is not set this will fallback to config
Set the currently active configuration object. Note that the existing active config will not be renamed to the new identifier.
Get the currently active configuration identifier. Will fall back to default_config if unassigned.
Get the available configurations as a map of friendly_name to configuration name.
Set multiple options. This does not merge recursively, but only at the top level.
Associative array of data-attributes to apply to the underlying text-area
Set the rules for allowed elements and attributes from a HTMLEditorRuleSet.
Set the rules for allowed elements and attributes from an associative array.
Get the name of the client-side component to inject for fields using this config
Provide additional schema data for the field this object configures
Get the number of rows this config will use in its editable area.
Set the number of rows this config will use in its editable area.
Get the string used to identify this config class in the CMS JavaScript.
Details
        
                static            Config_ForClass
    config()
        
    
    Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .....).
        
                            mixed
    uninherited(string $name)
        
    
    Gets the uninherited value for the given config option
        
                static            Injectable
    create(mixed ...$args)
        
    
    An implementation of the factory method, allows you to create an instance of a class
This method will defer class substitution to the Injector API, which can be customised via the Config API to declare substitution classes.
This can be called in one of two ways - either calling via the class directly, or calling on Object and passing the class name as the first parameter. The following are equivalent: $list = DataList::create(SiteTree::class); $list = SiteTree::get();
        
                static            Injectable
    singleton(string $class = null)
        
    
    Creates a class instance by the "singleton" design pattern.
It will always return the same instance for this class, which can be used for performance reasons and as a simple way to access instance methods which don't rely on instance data (e.g. the custom SilverStripe static handling).
        
                static            HTMLEditorConfig
    get(string $identifier = null)
        
    
    Get the HTMLEditorConfig object for the given identifier. This is a correct way to get an HTMLEditorConfig instance - do not call 'new'
The config instance will be created if one does not yet exist for that identifier.
        
                static            HTMLEditorConfig|null
    set_config(string $identifier, HTMLEditorConfig|null $config = null)
        
    
    Assign a new config, or clear existing, for the given identifier
        
                static            array
    getThemes()
        
    
    Gets the current themes, if it is not set this will fallback to config
        
                static            void
    setThemes(array $themes)
        
    
    Sets the current theme
        
                static            void
    set_active_identifier(string $identifier)
        
    
    Set the currently active configuration object. Note that the existing active config will not be renamed to the new identifier.
        
                static            string
    get_active_identifier()
        
    
    Get the currently active configuration identifier. Will fall back to default_config if unassigned.
        
                static            HTMLEditorConfig
    get_active()
        
    
    Get the currently active configuration object
        
                static            HTMLEditorConfig
    set_active(HTMLEditorConfig $config)
        
    
    Assigns the currently active config an explicit instance
        
                static            array
    get_available_configs_map()
        
    
    Get the available configurations as a map of friendly_name to configuration name.
        
                            mixed
    getOption(string $key)
        
    
    Get the current value of an option
        
                            HTMLEditorConfig
    setOption(string $key, mixed $value)
        
    
    Set the value of one option
        
                            array
    getOptions()
        
    
    Get the options for this config
        
                            HTMLEditorConfig
    setOptions(array $options)
        
    
    Set multiple options. This does not merge recursively, but only at the top level.
        
                            array
    getAttributes()
        
    
    Associative array of data-attributes to apply to the underlying text-area
        
                            void
    init()
        
    
    Initialise the editor on the client side
        
                            HTMLEditorRuleSet
    getElementRuleSet()
        
    
    Get the element rules for server-side sanitisation.
Changes made to this ruleset may not affect the config. If you alter it, make sure you pass it into a call to setElementRuleSet().
        
                            HTMLEditorConfig
    setElementRuleSet(HTMLEditorRuleSet $ruleset)
        
    
    Set the rules for allowed elements and attributes from a HTMLEditorRuleSet.
This will override any previously defined allowed element or attribute rules.
        
                            HTMLEditorConfig
    setElementRulesFromArray(array $rulesArray)
        
    
    Set the rules for allowed elements and attributes from an associative array.
This will override any previously defined allowed element or attribute rules.
        
                            string
    getSchemaComponent()
        
    
    Get the name of the client-side component to inject for fields using this config
        
                            array
    getConfigSchemaData()
        
    
    Provide additional schema data for the field this object configures
        
                            int|null
    getRows()
        
    
    Get the number of rows this config will use in its editable area.
        
                            HTMLEditorConfig
    setRows(int $numRows)
        
    
    Set the number of rows this config will use in its editable area.
This is set by HTMLEditorField - set the number of rows in your field.
        
                    protected        string
    getConfigType()
        
    
    Get the string used to identify this config class in the CMS JavaScript.