model/modx/modscript.class.php
- abstract
- Implement a derivative class that defines a table for storage.
- package
- modx
- Classes
- modScript
Description
An element representing executable PHP script content.
{@inheritdoc}
\modScript
- Extends from
- \modElement
- abstract
- Implement a derivative class that defines a table for storage.
- package
- modx
- Properties
- $_scriptCacheKey
- $_scriptName
- Methods
- getScriptCacheKey
- getScriptName
- loadScript
- process
- set
Description
An element representing executable PHP script content.
{@inheritdoc}
Properties
$_scriptCacheKey
$_scriptCacheKey = 'null'
Details
- visibility
- public
- default
- null
- final
- false
- static
- false
$_scriptName
$_scriptName = 'null'
Details
- visibility
- public
- default
- null
- final
- false
- static
- false
Methods
getScriptCacheKey
getScriptCacheKey(
)
:
string
Get the name of the script source file, written to the cache file system
Output
- string
- The filename containing the function generated from the script element.
Details
- visibility
- public
- final
- false
- static
- false
getScriptName
getScriptName(
)
:
string
Get the name of the function the script has been given.
Output
- string
- The function name representing this script element.
Details
- visibility
- public
- final
- false
- static
- false
loadScript
loadScript(
)
:
boolean
Loads and evaluates the script, returning the result.
Output
- boolean
- True if the result of the script is not false.
Details
- visibility
- public
- final
- false
- static
- false
process
process(
array|string $properties
=
null, string $content
=
null
)
:
mixed
Process specifically script-related functionality for modScript objects.
{@inheritdoc}
Arguments
- $properties
- arraystring
A set of configuration properties for the element. - $content
- string
Optional content to use in place of any persistent content associated with the element.
Output
- mixed
- The result of processing.
Details
- visibility
- public
- final
- false
- static
- false
set
set(
string $k, mixed $v
=
null, string|\callable $vType
)
:
boolean
Override set to properly strip invalid tags from script code
{@inheritdoc}
Arguments
- $k
- string
The field key or name. - $v
- mixed
The value to set the field to. - $vType
- string\callable
A string indicating the format of the provided value parameter, or a callable function that should be used to set the field value, overriding the default behavior.
Output
- boolean
- Determines whether the value was set successfully and was determined to be dirty (i.e. different from the previous value).
Details
- visibility
- public
- final
- false
- static
- false