Constants

REGEXP_ROUTE_VARIABLE_EXPRESSION

REGEXP_ROUTE_VARIABLE_EXPRESSION = "(:([^{}]*|\{([^{}]*|\{[^{}]*\})*\})*)?"

CLASS_METHOD

CLASS_METHOD = 'renderPage'

Properties

$translators

$translators : array

Type

array — translators

$container

$container : \Psr\Container\ContainerInterface

Type

\Psr\Container\ContainerInterface — container

$dispatcher

$dispatcher : \FastRoute\Dispatcher

Type

\FastRoute\Dispatcher — dispatcher

$routes

$routes : array

Type

array — routes

$avoid_parameter_names

$avoid_parameter_names : array

Type

array — reserved parameter names

Methods

__construct()

__construct(\Psr\Container\ContainerInterface  $container) : mixed

class constructor

Parameters

\Psr\Container\ContainerInterface $container

Throws

\Exception

Returns

mixed —

getTranslator()

getTranslator(string|null  $locale_code = null) : \Fisharebest\Localization\Translator

gets translator

Parameters

string|null $locale_code

Throws

\DI\DependencyException
\DI\NotFoundException

Returns

\Fisharebest\Localization\Translator —

__call()

__call(string  $name, mixed  $arguments) : mixed

{@inheritdocs}

Parameters

string $name
mixed $arguments

Throws

\App\Base\Exceptions\InvalidValueException

Returns

mixed —

getContainer()

getContainer() : \Psr\Container\ContainerInterface

gets container object

Returns

\Psr\Container\ContainerInterface —

getApp()

getApp() : \App\App

gets app object

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\App\App —

getLog()

getLog() : \Monolog\Logger

gets log object

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\Monolog\Logger —

getTemplates()

getTemplates() : \League\Plates\Engine

gets plates engine object

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\League\Plates\Engine —

getDebugbar()

getDebugbar() : \DebugBar\StandardDebugBar

gets debugbar object

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\DebugBar\StandardDebugBar —

getDb()

getDb() : \LessQL\Database

gets db object

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\LessQL\Database —

getPdo()

getPdo() : \PDO

gets PDO object

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\PDO —

getSchema()

getSchema() : \Degami\SqlSchema\Schema

gets schema object

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\Degami\SqlSchema\Schema —

getEventManager()

getEventManager() : \Gplanchat\EventManager\SharedEventEmitter

gets events manager service

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\Gplanchat\EventManager\SharedEventEmitter —

getWebRouter()

getWebRouter() : \App\Site\Routing\Web

gets routing service

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\App\Site\Routing\Web —

getCrudRouter()

getCrudRouter() : \App\Site\Routing\Crud

gets crud service

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\App\Site\Routing\Crud —

getRouters()

getRouters() : array

gets routers

Throws

\Degami\Basics\Exceptions\BasicException

Returns

array —

getUtils()

getUtils() : \App\Base\Tools\Utils\Globals

gets global utils service

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\App\Base\Tools\Utils\Globals —

getSiteData()

getSiteData() : \App\Base\Tools\Utils\SiteData

gets site data service

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\App\Base\Tools\Utils\SiteData —

getAssets()

getAssets() : \App\Base\Tools\Assets\Manager

gets assets manager

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\App\Base\Tools\Assets\Manager —

getGuzzle()

getGuzzle() : \GuzzleHttp\Client

gets guzzle service

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\GuzzleHttp\Client —

getImagine()

getImagine() : \Imagine\Gd\Imagine

gets imagine service

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\Imagine\Gd\Imagine —

getMailer()

getMailer() : \App\Base\Tools\Utils\Mailer

gets mailer service

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\App\Base\Tools\Utils\Mailer —

getSesMailer()

getSesMailer() : \Aws\Ses\SesClient

gets SES mailer service

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\Aws\Ses\SesClient —

getSmtpMailer()

getSmtpMailer() : \Swift_Mailer

gets SMTP mailer service

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\Swift_Mailer —

getCache()

getCache() : \App\Base\Tools\Cache\Manager

get cache manager

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\App\Base\Tools\Cache\Manager —

getHtmlRenderer()

getHtmlRenderer() : \App\Base\Tools\Utils\HtmlPartsRenderer

gets html renderer service

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\App\Base\Tools\Utils\HtmlPartsRenderer —

getIcons()

getIcons() : \Feather\Icons

gets icons service

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\Feather\Icons —

getElasticsearch()

getElasticsearch() : \ElasticSearch\Client

gets elasticsearch service

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\ElasticSearch\Client —

getEnv()

getEnv(string  $variable, mixed  $default = null) : mixed

gets env variable

Parameters

string $variable
mixed $default

Throws

\Degami\Basics\Exceptions\BasicException

Returns

mixed —

getRequest()

getRequest() : \Symfony\Component\HttpFoundation\Request

gets current request object

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\Symfony\Component\HttpFoundation\Request —

getAppRouteInfo()

getAppRouteInfo() : \App\Site\Routing\RouteInfo|null

gets route info

Returns

\App\Site\Routing\RouteInfo|null —

getAppWebsite()

getAppWebsite() : \App\Site\Models\Website|null

gets current website

Returns

\App\Site\Models\Website|null —

requestUrl()

requestUrl(string  $url, string  $method = 'GET', array  $options = []) : string|bool

executes an http request

Parameters

string $url
string $method
array $options

Throws

\Exception
\GuzzleHttp\Exception\GuzzleException

Returns

string|bool —

addRoute()

addRoute(string  $group, string  $name, string  $path, string  $class, string  $method = 'renderPage', string[]  $verbs = ['GET', 'POST']) : self

adds a route

Parameters

string $group
string $name
string $path
string $class
string $method
string[] $verbs

Returns

self —

checkRoute()

checkRoute(\Psr\Container\ContainerInterface  $container, string  $route) : bool

checks a route

Parameters

\Psr\Container\ContainerInterface $container
string $route

Throws

\Degami\Basics\Exceptions\BasicException
\Phpfastcache\Exceptions\PhpfastcacheSimpleCacheException

Returns

bool —

getDispatcher()

getDispatcher() : \FastRoute\Dispatcher

gets dispatcher

Returns

\FastRoute\Dispatcher —

getRoute()

getRoute(string  $name) : array

gets a single route

Parameters

string $name

Returns

array —

getBaseUrl()

getBaseUrl() : string

return base site url

Throws

\Degami\Basics\Exceptions\BasicException

Returns

string —

getUrl()

getUrl(string  $route_name, array  $route_params = []) : string

Returns url for given route

Parameters

string $route_name
array $route_params

Throws

\Degami\Basics\Exceptions\BasicException

Returns

string —

getRequestInfo()

getRequestInfo(\Psr\Container\ContainerInterface  $container, string|null  $http_method = null, string|null  $request_uri = null, string|null  $domain = null) : \App\Site\Routing\RouteInfo

returns a RouteInfo instance for current request

Parameters

\Psr\Container\ContainerInterface $container
string|null $http_method
string|null $request_uri
string|null $domain

Throws

\Degami\Basics\Exceptions\BasicException
\DI\DependencyException
\DI\NotFoundException
\Phpfastcache\Exceptions\PhpfastcacheSimpleCacheException

Returns

\App\Site\Routing\RouteInfo —

getService()

getService(string  $service_key) : mixed

gets registered service

Parameters

string $service_key

Throws

\Degami\Basics\Exceptions\BasicException

Returns

mixed —

getRouterName()

getRouterName() : string

gets Router name

Returns

string —

checkRouteParameters()

checkRouteParameters(string  $route) : bool

checks route parameters

Parameters

string $route

Returns

bool —

checkRouteVerbs()

checkRouteVerbs(array  $verbs) : array

checks route http verbs

Parameters

array $verbs

Returns

array —

getRouteByClass()

getRouteByClass(string  $class, string|null  $uri = null, string|null  $http_method = null) : array

gets route by class

Parameters

string $class
string|null $uri
string|null $http_method

Returns

array —

getCacheKey()

getCacheKey(string  $element) : string

compose cache key

Parameters

string $element

Returns

string —

getArrayFromCache()

getArrayFromCache( $array_name) : array

gets array from cache

Parameters

$array_name

Throws

\Degami\Basics\Exceptions\BasicException
\Phpfastcache\Exceptions\PhpfastcacheSimpleCacheException

Returns

array —

setArrayInCache()

setArrayInCache( $array_name,  $array) : self

sets array in cache

Parameters

$array_name
$array

Throws

\Degami\Basics\Exceptions\BasicException
\Phpfastcache\Exceptions\PhpfastcacheSimpleCacheException

Returns

self —

setCachedRoutes()

setCachedRoutes(array  $routes) : $this

sets cached routes

Parameters

array $routes

Throws

\Degami\Basics\Exceptions\BasicException
\Phpfastcache\Exceptions\PhpfastcacheSimpleCacheException

Returns

$this —

getCachedRewrites()

getCachedRewrites() : array

gets cached routes

Throws

\Degami\Basics\Exceptions\BasicException
\Phpfastcache\Exceptions\PhpfastcacheSimpleCacheException

Returns

array —

setCachedControllers()

setCachedControllers(array  $controllers) : self

sets cached controllers

Parameters

array $controllers

Throws

\Degami\Basics\Exceptions\BasicException
\Phpfastcache\Exceptions\PhpfastcacheSimpleCacheException

Returns

self —

getCachedControllers()

getCachedControllers() : array

gets cached controllers

Throws

\Degami\Basics\Exceptions\BasicException
\Phpfastcache\Exceptions\PhpfastcacheSimpleCacheException

Returns

array —

checkRewrites()

checkRewrites(string  $uri) : \App\Site\Models\Rewrite|null

gets rewrite object by uri

Parameters

string $uri

Returns

\App\Site\Models\Rewrite|null —

getClassHttpVerbs()

getClassHttpVerbs( $controller_class) : array

gets Class applicable route http verbs

Parameters

$controller_class

Throws

\App\Base\Exceptions\InvalidValueException

Returns

array —

getHttpVerbs()

getHttpVerbs() : array

defines http default verbs

Returns

array —

insertRoutes()

insertRoutes(\FastRoute\RouteCollector  $r, array  $paths) : self

adds routes

Parameters

\FastRoute\RouteCollector $r
array $paths

Returns

self —

insertRoute()

insertRoute(\FastRoute\RouteCollector  $r, array  $p) : self

adds a route

Parameters

\FastRoute\RouteCollector $r
array $p

Returns

self —