- Модуль: tasks
- Путь к файлу: ~/bitrix/modules/tasks/lib/dispatcher.php
- Класс: BitrixTasksDispatcher
- Вызов: Dispatcher::restRegister
static function restRegister($rest)
{
$rest = mb_strtolower(trim((string)$rest));
if (
!isset($rest) || $rest == '' ||
!preg_match('#^([a-z_]+[a-z0-9_]+)(.[a-z_]+[a-z0-9_]+)+$#', $rest)
)
{
return false;
}
$path = explode('.', $rest);
$method = array_pop($path);
$namespace = array_map('ucfirst', $path);
$classPrefix = '\Bitrix\Tasks\Dispatcher\Publicaction\';
$class = $classPrefix . implode('\', $namespace);
if (method_exists($class, $method))
{
static::$currentRestMehtod = $rest;
return array(
'scope' => 'task',
'callback' => array(
'\'.__CLASS__, 'restGateway'
)
);
}
else
{
return false;
}
}