EditorSetting

Editor settings that affect all users

 class Backend\Models\EditorSetting
extends Model

Extends

Class Description
Model

Traits

Trait Description
Validation
ViewMaker

View Maker Trait Adds view based methods to a class

Properties

public $cacheKey : string

The key to store rendered CSS in the cache under

public $implement : array

Behaviors implemented by this model.

public $rules : mixed

Validation rules

public $settingsCode : string

Unique code

public $settingsFields : mixed

Settings form field definitions

protected $defaultHtmlAllowAttributes : mixed

protected $defaultHtmlAllowEmptyTags : mixed

protected $defaultHtmlAllowTags : mixed

protected $defaultHtmlLineBreakerTags : mixed

protected $defaultHtmlNoWrapTags : mixed

protected $defaultHtmlParagraphFormats : mixed

protected $defaultHtmlRemoveTags : mixed

protected $defaultHtmlStyleImage : mixed

protected $defaultHtmlStyleLink : mixed

protected $defaultHtmlStyleParagraph : mixed

protected $defaultHtmlStyleTable : mixed

protected $defaultHtmlStyleTableCell : mixed

protected $editorToolbarPresets : mixed

Editor toolbar presets for Froala.

inherited public $layout : string

Inherited from ViewMaker

Layout to use for the view.

inherited public $suppressLayout : bool

Inherited from ViewMaker

Prevents the use of a layout.

inherited public $vars : array

Inherited from ViewMaker

A list of variables to pass to the page.

inherited protected $layoutPath : string

Inherited from ViewMaker

Specifies a path to the layout directory.

inherited protected $validationDefaultAttrNames : array

Inherited from Validation

Default custom attribute names.

inherited protected $validationErrors : Illuminate\Support\MessageBag

Inherited from Validation

The message bag instance containing validation error messages

inherited protected $viewPath : string | array

Inherited from ViewMaker

Specifies a path to the views directory.

Methods

public afterFetch ()

Returns
mixed

public afterSave ()

Returns
mixed

public static compileCss ()

Returns
mixed

public static getConfigured ($key, $default = null) : mixed

Returns the value only if it differs from the default value.

Parameters
Property Description
$key
mixed
$default
mixed
Returns
mixed

public static getConfiguredFormats ($key, $default = null) : mixed

Same as getConfigured but uses a special structure for paragraph formats.

Parameters
Property Description
$key
mixed
$default
mixed
Returns
mixed

public static getConfiguredStyles ($key, $default = null) : mixed

Same as getConfigured but uses a special structure for styles.

Parameters
Property Description
$key
mixed
$default
mixed
Returns
mixed

public getDefaultValue ($attribute)

Parameters
Property Description
$attribute
mixed
Returns
mixed

public getEditorToolbarPresets () : array

Return the editor toolbar presets without line breaks.

Returns
array

public initSettingsData () : void

Initialize the seed data for this model. This only executes when the model is first created or reset to default.

Returns
void

public static renderCss ()

Returns
mixed

protected static getConfiguredArray ($key, $default = null, $callback = null)

Parameters
Property Description
$key
mixed
$default
mixed
$callback
mixed
Returns
mixed

protected makeFormatsForTable ($arr)

Parameters
Property Description
$arr
mixed
Returns
mixed

protected makeStylesForTable ($arr)

Parameters
Property Description
$arr
mixed
Returns
mixed

inherited public addViewPath (string | array $path) : void

Inherited from ViewMaker

Prepends a path on the available view path locations.

Parameters
Property Description
$path
string | array
Returns
void

inherited public static bootValidation () : void

Inherited from Validation

Boot the validation trait for this model.

Returns
void

inherited public errors () : Illuminate\Support\MessageBag

Inherited from Validation

Get validation error message collection for the Model

Returns
Illuminate\Support\MessageBag

inherited public forceSave ($options = null, $sessionKey = null) : bool

Inherited from Validation

Force save the model even if validation fails.

Parameters
Property Description
$options
mixed
$sessionKey
mixed
Returns
bool

inherited public getViewPath (string $fileName, $viewPaths = null) : string

Inherited from ViewMaker

Locates a file based on its definition. The file name can be prefixed with a symbol (~|$) to return in context of the application or plugin base path, otherwise it will be returned in context of this object view path.

If the fileName cannot be found it will be returned unmodified.

Parameters
Property Description
$fileName
string
$viewPaths
mixed
Returns
string

inherited public getViewPaths () : array

Inherited from ViewMaker

Returns the active view path locations.

Returns
array

inherited public guessViewPath (string $suffix = "", boolean $isPublic = false) : string | null

Inherited from ViewMaker

Guess the package path for the called class.

Parameters
Property Description
$suffix
string

An extra path to attach to the end

$isPublic
boolean

Returns public path instead of an absolute one

Returns
string | null

inherited public guessViewPathFrom (string $class, string $suffix = "", boolean $isPublic = false) : string | null

Inherited from ViewMaker

Guess the package path from a specified class.

Parameters
Property Description
$class
string

Class to guess path from.

$suffix
string

An extra path to attach to the end

$isPublic
boolean

Returns public path instead of an absolute one

Returns
string | null

inherited public isAttributeRequired (string $attribute, boolean $checkDependencies = true) : bool

Inherited from Validation

Determines if an attribute is required based on the validation rules.

Parameters
Property Description
$attribute
string
$checkDependencies
boolean

Checks the attribute dependencies (for required_if & required_with rules). Note that it will only be checked up to the next level, if another dependent rule is found then it will just assume the field is required

Returns
bool

inherited public makeFileContents (string $filePath, array $extraParams = []) : string

Inherited from ViewMaker

Includes a file path using output buffering, making the provided vars available.

Parameters
Property Description
$filePath
string
$extraParams
array
Returns
string

inherited public makeLayout ($name = null, array $params = [], boolean $throwException = true) : string | bool

Inherited from ViewMaker

Render a layout, defaulting to the layout propery specified on the class

Parameters
Property Description
$name
mixed
$params
array
$throwException
boolean
Returns
string | bool

The layout contents, or false.

inherited public makeLayoutPartial (string $partial, array $params = []) : string

Inherited from ViewMaker

Renders a layout partial

Parameters
Property Description
$partial
string
$params
array
Returns
string

inherited public makePartial (string $partial, array $params = [], boolean $throwException = true) : mixed

Inherited from ViewMaker

Render a partial file contents located in the views folder.

Parameters
Property Description
$partial
string
$params
array
$throwException
boolean
Returns
mixed

Partial contents or false if not throwing an exception.

inherited public makeView (string $view) : string

Inherited from ViewMaker

Loads the specified view. Applies the layout if one is set.

The view file must have the .php extension (or ".htm" for historical reasons) and be located in the views directory

Parameters
Property Description
$view
string
Returns
string

inherited public makeViewContent (string $contents, $layout = null) : string

Inherited from ViewMaker

Renders supplied contents inside a layout.

Parameters
Property Description
$contents
string
$layout
mixed
Returns
string

inherited public setValidationAttributeName (string $attr, string $name) : void

Inherited from Validation

Programatically sets the validation attribute names, will take lower priority to model defined attribute names found in $attributeNames.

Parameters
Property Description
$attr
string
$name
string
Returns
void

inherited public setValidationAttributeNames (array $attributeNames) : void

Inherited from Validation

Programatically sets multiple validation attribute names.

Parameters
Property Description
$attributeNames
array
Returns
void

inherited public validate ($rules = null, $customMessages = null, $attributeNames = null) : bool

Inherited from Validation

Validate the model instance

Parameters
Property Description
$rules
mixed
$customMessages
mixed
$attributeNames
mixed
Returns
bool

inherited public static validated (Closure | string $callback) : void

Inherited from Validation

Create a new native event for handling afterValidate().

Parameters
Property Description
$callback
Closure | string
Returns
void

inherited public static validating (Closure | string $callback) : void

Inherited from Validation

Create a new native event for handling beforeValidate().

Parameters
Property Description
$callback
Closure | string
Returns
void

inherited protected getRelationValidationValue ($relationName)

Inherited from Validation

Attachments validate differently to their simple values.

Parameters
Property Description
$relationName
mixed
Returns
mixed

inherited protected getValidationAttributes () : array

Inherited from Validation

Returns the model data used for validation.

Returns
array

inherited protected handleViewException (Throwable $e, integer $obLevel) : void

Inherited from ViewMaker

Handle a view exception.

Parameters
Property Description
$e
Throwable
$obLevel
integer
Returns
void

inherited protected static makeValidator ($data, $rules, $customMessages, $attributeNames, $connection = null) : Illuminate\Contracts\Validation\Validator

Inherited from Validation

Instantiates the validator used by the validation process, depending if the class is being used inside or outside of Laravel. Optional connection string to make the validator use a different database connection than the default connection.

Parameters
Property Description
$data
mixed
$rules
mixed
$customMessages
mixed
$attributeNames
mixed
$connection
mixed
Returns
Illuminate\Contracts\Validation\Validator

inherited protected processRuleFieldNames (array $rules) : array

Inherited from Validation

Processes field names in a rule array.

Converts any field names using array notation (ie. field[child]) into dot notation (ie. field.child)

Parameters
Property Description
$rules
array

Rules array

Returns
array

inherited protected processValidationRules ($rules)

Inherited from Validation

Process rules

Parameters
Property Description
$rules
mixed
Returns
mixed

inherited protected processValidationUniqueRule (string $definition, string $fieldName) : string

Inherited from Validation

Rebuilds the unique validation rule to force for the existing ID

Parameters
Property Description
$definition
string
$fieldName
string
Returns
string
Copyright © 2024 Winter CMS