App
extends App
in package
Class App
Table of Contents
- $helpers : mixed
- $layout : mixed
- $request : Request|null
- $response : Response|null
- $viewvars : mixed
- $apps : mixed
- $blocks : mixed
- $events : mixed
- $exit : mixed
- $paths : mixed
- $registry : mixed
- $routes : mixed
- __construct() : mixed
- Constructor
- __get() : mixed
- __invoke() : mixed
- assets() : mixed
- base() : mixed
- baseUrl() : string
- Returns link based on the base url of the app
- bind() : void
- Bind request to route
- bindClass() : void
- Bind Class to routes
- bindNamespace() : void
- Bind namespace to routes
- block() : string
- Get block content
- cache() : mixed
- Cache helper method
- decode() : mixed
- Decode RC4 encrypted text
- dispatch() : mixed
- Dispatch route
- encode() : mixed
- RC4 encryption
- end() : null
- End block
- escape() : string
- Escape string.
- get() : void
- Bind GET request to route
- getClientIp() : string
- Get client ip.
- getClientLang() : string
- Get client language
- getSiteUrl() : string
- Get site url
- hash() : string
- Create Hash
- helper() : mixed
- instance() : object
- Get App instance
- invoke() : mixed
- Invoke Class as controller
- isAbsolutePath() : mixed
- isExit() : bool
- Is application stopped?
- loadModules() : mixed
- module() : mixed
- offsetExists() : mixed
- offsetGet() : mixed
- offsetSet() : mixed
- offsetUnset() : mixed
- on() : void
- Bind an event to closure
- param() : mixed
- Get request variables
- path() : mixed
- Path helper method
- paths() : array<string|int, mixed>
- pathToUrl() : bool|string
- post() : void
- Bind POST request to route
- registerModule() : mixed
- render() : string
- Render view.
- renderView() : mixed
- Outputs view content result
- req_is() : bool
- Request helper function
- reroute() : void
- Redirect to path.
- retrieve() : mixed
- Get a value from the Lime registry
- route() : mixed
- routeUrl() : string
- Returns link based on the route url of the app
- run() : void
- Run Application
- script() : string
- Get script inc. markup
- service() : object
- Returns a closure that stores the result of the given closure
- set() : mixed
- Put a value in the Lime registry
- start() : null
- Start block
- stop() : mixed
- stop application (exit)
- style() : string
- Get style inc. markup
- trigger() : bool
- Trigger event.
- view() : string
- Render view.
- bootModule() : mixed
- getRequestfromGlobals() : mixed
- render_route() : string
- Render dispatched route
Properties
$helpers
public
mixed
$helpers
$layout
public
mixed
$layout
= false
$request
public
Request|null
$request
= null
$response
public
Response|null
$response
= null
$viewvars
public
mixed
$viewvars
= []
$apps
protected
static mixed
$apps
= []
$blocks
protected
mixed
$blocks
= []
$events
protected
mixed
$events
= []
$exit
protected
mixed
$exit
= false
$paths
protected
mixed
$paths
= []
$registry
protected
mixed
$registry
= []
$routes
protected
mixed
$routes
= []
Methods
__construct()
Constructor
public
__construct([array<string|int, mixed> $settings = [] ]) : mixed
Parameters
- $settings : array<string|int, mixed> = []
Return values
mixed —__get()
public
__get(mixed $name) : mixed
Parameters
- $name : mixed
Return values
mixed —__invoke()
public
__invoke(mixed $helper) : mixed
Parameters
- $helper : mixed
Return values
mixed —assets()
public
assets(mixed $src[, mixed $version = false ]) : mixed
Parameters
- $src : mixed
- $version : mixed = false
Return values
mixed —base()
public
base(mixed $path) : mixed
Parameters
- $path : mixed
Return values
mixed —baseUrl()
Returns link based on the base url of the app
public
baseUrl(string $path) : string
Parameters
- $path : string
-
e.g. /js/myscript.js
Return values
string —Link
bind()
Bind request to route
public
bind(string $path, Closure $callback[, bool $condition = true ]) : void
Parameters
- $path : string
- $callback : Closure
- $condition : bool = true
Return values
void —bindClass()
Bind Class to routes
public
bindClass(string $class[, mixed $alias = false ]) : void
Parameters
- $class : string
- $alias : mixed = false
Return values
void —bindNamespace()
Bind namespace to routes
public
bindNamespace(string $namespace, mixed $alias) : void
Parameters
- $namespace : string
- $alias : mixed
Return values
void —block()
Get block content
public
block(string $name[, array<string|int, mixed> $options = [] ]) : string
Parameters
- $name : string
- $options : array<string|int, mixed> = []
Return values
string —cache()
Cache helper method
public
cache() : mixed
Return values
mixed —decode()
Decode RC4 encrypted text
public
decode(mixed $data, mixed $pwd) : mixed
Parameters
- $data : mixed
- $pwd : mixed
Return values
mixed —dispatch()
Dispatch route
public
dispatch(string $path) : mixed
Parameters
- $path : string
Return values
mixed —encode()
RC4 encryption
public
encode(mixed $data, mixed $pwd[, bool $base64encoded = false ]) : mixed
Parameters
- $data : mixed
- $pwd : mixed
- $base64encoded : bool = false
-
[description]
Return values
mixed —end()
End block
public
end(string $name) : null
Parameters
- $name : string
Return values
null —escape()
Escape string.
public
escape(string $string[, string $charset = null ]) : string
Parameters
- $string : string
- $charset : string = null
Return values
string —get()
Bind GET request to route
public
get(string $path, Closure $callback[, bool $condition = true ]) : void
Parameters
- $path : string
- $callback : Closure
- $condition : bool = true
Return values
void —getClientIp()
Get client ip.
public
getClientIp() : string
Return values
string —getClientLang()
Get client language
public
getClientLang([mixed $default = "en" ]) : string
Parameters
- $default : mixed = "en"
Return values
string —getSiteUrl()
Get site url
public
getSiteUrl([mixed $withpath = false ]) : string
Parameters
- $withpath : mixed = false
Return values
string —hash()
Create Hash
public
hash(mixed $text[, mixed $algo = PASSWORD_BCRYPT ]) : string
Parameters
- $text : mixed
- $algo : mixed = PASSWORD_BCRYPT
Return values
string —helper()
public
helper(mixed $helper) : mixed
Parameters
- $helper : mixed
Return values
mixed —instance()
Get App instance
public
static instance(string $name) : object
Parameters
- $name : string
-
Lime app name
Return values
object —Lime app object
invoke()
Invoke Class as controller
public
invoke(string $class[, string $action = "index" ][, array<string|int, mixed> $params = [] ]) : mixed
Parameters
- $class : string
- $action : string = "index"
- $params : array<string|int, mixed> = []
Return values
mixed —isAbsolutePath()
public
isAbsolutePath(mixed $path) : mixed
Parameters
- $path : mixed
Return values
mixed —isExit()
Is application stopped?
public
isExit() : bool
Return values
bool —loadModules()
public
loadModules(mixed $dirs[, mixed $autoload = true ][, mixed $prefix = false ]) : mixed
Parameters
- $dirs : mixed
- $autoload : mixed = true
- $prefix : mixed = false
Return values
mixed —module()
public
module(mixed $name) : mixed
Parameters
- $name : mixed
Return values
mixed —offsetExists()
public
offsetExists(mixed $key) : mixed
Parameters
- $key : mixed
Return values
mixed —offsetGet()
public
offsetGet(mixed $key) : mixed
Parameters
- $key : mixed
Return values
mixed —offsetSet()
public
offsetSet(mixed $key, mixed $value) : mixed
Parameters
- $key : mixed
- $value : mixed
Return values
mixed —offsetUnset()
public
offsetUnset(mixed $key) : mixed
Parameters
- $key : mixed
Return values
mixed —on()
Bind an event to closure
public
on(string $event, Closure $callback, int $priority) : void
Parameters
- $event : string
- $callback : Closure
- $priority : int
Return values
void —param()
Get request variables
public
param([string $index = null ][, mixed $default = null ][, array<string|int, mixed> $source = null ]) : mixed
Parameters
- $index : string = null
- $default : mixed = null
- $source : array<string|int, mixed> = null
Return values
mixed —path()
Path helper method
public
path() : mixed
Return values
mixed —paths()
public
paths([ $namespace = null ]) : array<string|int, mixed>
Parameters
Return values
array<string|int, mixed> —pathToUrl()
public
pathToUrl( $path[, mixed $full = false ]) : bool|string
Parameters
Return values
bool|string —post()
Bind POST request to route
public
post(string $path, Closure $callback[, bool $condition = true ]) : void
Parameters
- $path : string
- $callback : Closure
- $condition : bool = true
Return values
void —registerModule()
public
registerModule(mixed $name, mixed $dir) : mixed
Parameters
- $name : mixed
- $dir : mixed
Return values
mixed —render()
Render view.
public
render(string $____template[, array<string|int, mixed> $_____slots = [] ]) : string
Parameters
- $____template : string
-
Path to view
- $_____slots : array<string|int, mixed> = []
-
Passed variables
Return values
string —Rendered view
renderView()
Outputs view content result
public
renderView( $template[, array<string|int, mixed> $slots = [] ]) : mixed
Parameters
Return values
mixed —req_is()
Request helper function
public
req_is(string $type) : bool
Parameters
- $type : string
Return values
bool —reroute()
Redirect to path.
public
reroute(string $path) : void
Parameters
- $path : string
-
Path redirect to.
Return values
void —retrieve()
Get a value from the Lime registry
public
retrieve(string $key[, mixed $default = null ]) : mixed
Parameters
- $key : string
- $default : mixed = null
Return values
mixed —route()
public
route() : mixed
Return values
mixed —routeUrl()
Returns link based on the route url of the app
public
routeUrl(string $path) : string
Parameters
- $path : string
-
e.g. /pages/home
Return values
string —Link
run()
Run Application
public
run([string $route = null ][, mixed $request = null ][, mixed $flush = true ]) : void
Parameters
- $route : string = null
-
Route to parse
- $request : mixed = null
- $flush : mixed = true
Return values
void —script()
Get script inc. markup
public
script(string $src[, mixed $version = false ]) : string
Parameters
- $src : string
- $version : mixed = false
Return values
string —service()
Returns a closure that stores the result of the given closure
public
service(string $name, Closure $callable) : object
Parameters
- $name : string
- $callable : Closure
Return values
object —set()
Put a value in the Lime registry
public
set(string $key, mixed $value) : mixed
Parameters
- $key : string
-
Key name
- $value : mixed
-
Value
Return values
mixed —start()
Start block
public
start(string $name) : null
Parameters
- $name : string
Return values
null —stop()
stop application (exit)
public
stop([mixed $data = false ][, mixed $status = null ]) : mixed
Parameters
- $data : mixed = false
- $status : mixed = null
Return values
mixed —style()
Get style inc. markup
public
style(string $href[, mixed $version = false ]) : string
Parameters
- $href : string
- $version : mixed = false
Return values
string —trigger()
Trigger event.
public
trigger(string $event[, array<string|int, mixed> $params = [] ]) : bool
Parameters
- $event : string
- $params : array<string|int, mixed> = []
Return values
bool —view()
Render view.
public
view(string $template[, array<string|int, mixed> $slots = [] ]) : string
Parameters
- $template : string
-
Path to view
- $slots : array<string|int, mixed> = []
-
Passed variables
Return values
string —Rendered view
bootModule()
protected
bootModule(mixed $module) : mixed
Parameters
- $module : mixed
Return values
mixed —getRequestfromGlobals()
protected
getRequestfromGlobals() : mixed
Return values
mixed —render_route()
Render dispatched route
protected
render_route(mixed $route[, array<string|int, mixed> $params = [] ]) : string
Parameters
- $route : mixed
- $params : array<string|int, mixed> = []