100 $safe = [
'is_safe' => [
'html']];
102 $this->addFunction(
'path',
function ($name, $params = [], $absolute =
false) {
103 return Router::path($name, $params, $absolute);
106 $this->addFunction(
'url',
function ($name, $params = []) {
107 return Router::url($name, $params);
110 if (\class_exists(
'\\Ubiquity\\security\\csrf\\UCsrfHttp')) {
111 $this->addFunction(
'csrfMeta',
function ($name) {
112 return \Ubiquity\security\csrf\UCsrfHttp::getTokenMeta($name);
114 $this->addFunction(
'csrf',
function ($name) {
115 return \Ubiquity\security\csrf\UCsrfHttp::getTokenField($name);
119 if (\class_exists(
'\\Ubiquity\security\\acl\\AclManager')) {
120 $this->addFunction(
'isAllowedRoute',
function ($role, $routeName) {
121 return \Ubiquity\security\acl\AclManager::isAllowedRoute($role, $routeName);
125 $this->addFunction(
'css',
function ($resource, $parameters = [], $absolute =
false) {
126 if ($this->hasThemeResource($resource)) {
127 return $this->safeString(AssetsManager::css_($resource, $parameters, $absolute));
129 return $this->safeString(AssetsManager::css($resource, $parameters, $absolute));
132 $this->addFunction(
'js',
function ($resource, $parameters = [], $absolute =
false) {
133 if ($this->hasThemeResource($resource)) {
134 return $this->safeString(AssetsManager::js_($resource, $parameters, $absolute));
136 return $this->safeString(AssetsManager::js($resource, $parameters, $absolute));
139 $this->addFunction(
'img',
function ($resource, $parameters = [], $absolute =
false) {
140 if ($this->hasThemeResource($resource)) {
141 return $this->safeString(AssetsManager::img_($resource, $parameters, $absolute));
143 return $this->safeString(AssetsManager::img($resource, $parameters, $absolute));