PHP Класс eZ\Publish\Core\REST\Common\RequestParser\Pattern

Handles 2 types of patterns to be used in an URL: - {foo} matches anything but a slash and is used to match the typical URL variable (e.g. an ID) - {&foo} matches the slash, too, and is used to match only those URL variables, which may have a slash
Наследование: implements eZ\Publish\Core\REST\Common\RequestParser
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$compileCache array Cache for compiled expressions.
$map array Map of URL types to their URL patterns.

Открытые методы

Метод Описание
__construct ( array $map = [] ) Construct from optional initial map.
addPattern ( string $type, string $pattern ) Adds a pattern for a type.
generate ( string $type, array $values = [] ) : string Generate a URL of the given type from the specified values.
parse ( string $url ) : array Parse URL and return the IDs contained in the URL.
parseHref ( $href, $attribute )

Защищенные методы

Метод Описание
compile ( string $pattern ) : string Compiles a given pattern to a PCRE regular expression.

Описание методов

__construct() публичный Метод

Construct from optional initial map.
public __construct ( array $map = [] )
$map array

addPattern() публичный Метод

Adds a pattern for a type.
public addPattern ( string $type, string $pattern )
$type string
$pattern string

compile() защищенный Метод

Compiles a given pattern to a PCRE regular expression.
protected compile ( string $pattern ) : string
$pattern string
Результат string

generate() публичный Метод

Generate a URL of the given type from the specified values.
public generate ( string $type, array $values = [] ) : string
$type string
$values array
Результат string

parse() публичный Метод

Parse URL and return the IDs contained in the URL.
public parse ( string $url ) : array
$url string
Результат array

parseHref() публичный Метод

public parseHref ( $href, $attribute )

Описание свойств

$compileCache защищенное свойство

Cache for compiled expressions.
protected array $compileCache
Результат array

$map защищенное свойство

Map of URL types to their URL patterns.
protected array $map
Результат array