1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
Класс Router

Открытые статические члены

static setRouteHandler ($route, $handlerModule, $handlerClass, array $handlerParameters)
static dispatch (Uri $uri)
static invalidateRouteCache ()

Поля данных

const CACHE_ID = 'UrlPreviewRouteCache'
const CACHE_TTL = 315360000

Защищенные статические члены

static parseQueryParams ($uriQuery)
static init ()
static persistRoute ($route, $isNew)
static convertRouteToRegexp (string $route, bool $allowSlashes=false)

Статические защищенные данные

static $routeTable = array()
static $managedCache
static $initialized = false

Подробное описание

См. определение в файле router.php строка 9

Методы

◆ convertRouteToRegexp()

convertRouteToRegexp ( string $route,
bool $allowSlashes = false )
staticprotected

Return regexp string for checking URL against route template.

Аргументы
string$routeRoute URL template.
bool$allowSlashesAllow slashes in regex search.
Возвращает
string

См. определение в файле router.php строка 243

◆ dispatch()

dispatch ( Uri $uri)
static

Returns handler for the url

Аргументы
Uri$uriAbsolute or relative URL.
Возвращает
array|false Handler for this URL if found, false otherwise.

См. определение в файле router.php строка 84

◆ init()

init ( )
staticprotected

Initializes router and prepares routing table.

Возвращает
void

См. определение в файле router.php строка 154

◆ invalidateRouteCache()

invalidateRouteCache ( )
static

Resets router cache

Возвращает
void

См. определение в файле router.php строка 260

◆ parseQueryParams()

parseQueryParams ( $uriQuery)
staticprotected

См. определение в файле router.php строка 134

◆ persistRoute()

persistRoute ( $route,
$isNew )
staticprotected

Persists routing table record in database

Аргументы
string$routeRoute URL template.
bool$isNewTrue if handler record was not encountered in router cache.
Возвращает
bool Returns true if route is successfully stored in the database table, and false otherwise.

См. определение в файле router.php строка 203

◆ setRouteHandler()

setRouteHandler ( $route,
$handlerModule,
$handlerClass,
array $handlerParameters )
static

Adds, or, if route already exists, changes route handling method.

Аргументы
string$routeRoute URL template. Route parameters should be enclosed in hash symbols, like '/user/#userId#/'.
string$handlerModuleRoute handler module.
string$handlerClassRoute handler class should implement methods:
  • buildPreview($params): string. Method must accept array of parameters and return rendered preview
  • checkUserReadAccess($params): boolean. Method must accept array of parameters. Method must return true if currently logged in user has read access to the entity; false otherwise.
  • getCacheTag(): string. Method must return cache tag for the entity.
.
array$handlerParametersArray of parameters, passed to the handler methods. Will be passed as the argument when calling handler's method for building preview or checking access. Array values may contain variables referencing route parameters. e.g. ['userId' => '$userId'].
Возвращает
void
Исключения
ArgumentException

См. определение в файле router.php строка 44

Поля

◆ $initialized

$initialized = false
staticprotected

См. определение в файле router.php строка 23

◆ $managedCache

$managedCache
staticprotected

См. определение в файле router.php строка 20

◆ $routeTable

$routeTable = array()
staticprotected

См. определение в файле router.php строка 17

◆ CACHE_ID

const CACHE_ID = 'UrlPreviewRouteCache'

См. определение в файле router.php строка 11

◆ CACHE_TTL

const CACHE_TTL = 315360000

См. определение в файле router.php строка 12


Объявления и описания членов класса находятся в файле:
  • C:/bitrix/modules/main/lib/urlpreview/router.php