Documentation

Mage_Core_Model_Layout_Validator
in package

Validator for custom layout update Validator checked XML validation and protected expressions

Table of Contents

Constants

INVALID_BLOCK_NAME  : mixed = 'invalidBlockName'
INVALID_TEMPLATE_PATH  : mixed = 'invalidTemplatePath'
INVALID_XML_OBJECT_EXCEPTION  : mixed = 'invalidXmlObject'
PROTECTED_ATTR_HELPER_IN_TAG_ACTION_VAR  : mixed = 'protectedAttrHelperInActionVar'
XML_INVALID  : mixed = 'invalidXml'

Properties

$_disallowedBlocks  : array<string|int, string>
Disallowed block names
$_disallowedXPathExpressions  : array<string|int, string>
XPath expression for checking layout update
$_messageTemplates  : array<string, string>
$_protectedExpressions  : array<string, string>
Protected expressions
$messages  : array<string|int, string>

Methods

__construct()  : mixed
getDisallowedBlocks()  : array<string|int, mixed>
getDisallowedXpathValidationExpression()  : array<string|int, mixed>
getMessages()  : array<string|int, mixed>
Returns array of errors
getProtectedExpressions()  : array<string|int, mixed>
getXpathBlockValidationExpression()  : string
Get XPath block validation expression
getXpathValidationExpression()  : string
Get XPath validation expression
isValid()  : bool
Returns true if and only if $value meets the validation requirements
setMessages()  : $this
Set messages for validator
validateTemplatePath()  : void
_error()  : void
Add error message
_getXpathBlockValidationExpression()  : string
_getXpathValidationExpression()  : string
_initMessageTemplates()  : $this
Initialize messages templates with translating
_validateTemplatePath()  : void

Constants

INVALID_BLOCK_NAME

public mixed INVALID_BLOCK_NAME = 'invalidBlockName'

INVALID_TEMPLATE_PATH

public mixed INVALID_TEMPLATE_PATH = 'invalidTemplatePath'

INVALID_XML_OBJECT_EXCEPTION

public mixed INVALID_XML_OBJECT_EXCEPTION = 'invalidXmlObject'

PROTECTED_ATTR_HELPER_IN_TAG_ACTION_VAR

public mixed PROTECTED_ATTR_HELPER_IN_TAG_ACTION_VAR = 'protectedAttrHelperInActionVar'

XML_INVALID

public mixed XML_INVALID = 'invalidXml'

Properties

$_disallowedBlocks

Disallowed block names

protected array<string|int, string> $_disallowedBlocks = []

$_disallowedXPathExpressions

XPath expression for checking layout update

protected array<string|int, string> $_disallowedXPathExpressions = ['*//template', '*//@template', '//*[@method=\'setTemplate\']', '//*[@method=\'setDataUsingMethod\']//*[contains(translate(text(), \'ABCDEFGHIJKLMNOPQRSTUVWXYZ\', \'abcdefghijklmnopqrstuvwxyz\'), \'template\')]/../*']

$_messageTemplates

protected array<string, string> $_messageTemplates = []

$_protectedExpressions

Protected expressions

protected array<string, string> $_protectedExpressions = [self::PROTECTED_ATTR_HELPER_IN_TAG_ACTION_VAR => '//action/*[@helper]']

$messages

protected array<string|int, string> $messages = []

Methods

getDisallowedBlocks()

public getDisallowedBlocks() : array<string|int, mixed>
Return values
array<string|int, mixed>

getDisallowedXpathValidationExpression()

public getDisallowedXpathValidationExpression() : array<string|int, mixed>
Return values
array<string|int, mixed>

getMessages()

Returns array of errors

public getMessages() : array<string|int, mixed>
Return values
array<string|int, mixed>

getProtectedExpressions()

public getProtectedExpressions() : array<string|int, mixed>
Return values
array<string|int, mixed>

getXpathBlockValidationExpression()

Get XPath block validation expression

public getXpathBlockValidationExpression() : string
Return values
string

getXpathValidationExpression()

Get XPath validation expression

public getXpathValidationExpression() : string
Return values
string

isValid()

Returns true if and only if $value meets the validation requirements

public isValid(Element|string $value) : bool
Parameters
$value : Element|string
Return values
bool

setMessages()

Set messages for validator

public setMessages(array<string|int, mixed> $messages) : $this
Parameters
$messages : array<string|int, mixed>
Return values
$this

validateTemplatePath()

public validateTemplatePath(array<string|int, mixed> $templatePaths) : void
Parameters
$templatePaths : array<string|int, mixed>

_error()

Add error message

protected _error(string $messageKey) : void
Parameters
$messageKey : string

_getXpathBlockValidationExpression()

protected _getXpathBlockValidationExpression() : string
Return values
string

_getXpathValidationExpression()

protected _getXpathValidationExpression() : string
Return values
string

_initMessageTemplates()

Initialize messages templates with translating

protected _initMessageTemplates() : $this
Return values
$this

_validateTemplatePath()

protected _validateTemplatePath(array<string|int, mixed> $templatePaths) : void
Parameters
$templatePaths : array<string|int, mixed>
Tags
throws
Mage_Core_Exception
On this page

Search results