PHP Класс Lime\App

Наследование: implements ArrayAccess
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$helpers
$layout
$mimeTypes * mime types
$response Response | null
$statusCodes * status codes
$viewvars * global view variables

Защищенные свойства (Protected)

Свойство Тип Описание
$apps
$blocks
$events
$exit
$paths
$registry
$routes

Открытые методы

Метод Описание
__construct ( Array $settings = [] ) Constructor
__get ( $name ) accces to services
__invoke ( $helper ) Invoke call
assets ( $src, $version = false )
base ( $path )
baseUrl ( String $path ) : String Returns link based on the base url of the app
bind ( String $path, Closure $callback, boolean $condition = true ) : void Bind request to route
bindClass ( String $class, $alias = false ) : void Bind Class to routes
bindNamespace ( String $namespace, $alias ) : void Bind namespace to routes
block ( String $name, array $options = [] ) : String Get block content
cache ( ) : Mixed Cache helper method
decode ( [type] $data, [type] $pwd ) : [type] Decode RC4 encrypted text
dispatch ( String $path ) : Mixed Dispatch route
encode ( [type] $data, [type] $pwd, boolean $base64encoded = false ) : [type] RC4 encryption
end ( String $name ) : Null End block
escape ( String $string, String $charset = null ) : String Escape string.
get ( String $path, Closure $callback, boolean $condition = true ) : void Bind GET request to route
getClientIp ( ) : String Get client ip.
getClientLang ( $default = "en" ) : String Get client language
getSiteUrl ( $withpath = false ) : String Get site url
hash ( $text, $algo = PASSWORD_BCRYPT ) : String Create Hash
helper ( $helper )
instance ( String $name ) : Object Get App instance
invoke ( String $class, String $action = "index", Array $params = [] ) : Mixed Invoke Class as controller
isAbsolutePath ( $path )
isExit ( ) : boolean Is application stopped?
loadModules ( $dirs, $autoload = true, $prefix = false )
module ( $name )
offsetExists ( $key )
offsetGet ( $key )
offsetSet ( $key, $value ) Array Access implementation
offsetUnset ( $key )
on ( String $event, Closure $callback, integer $priority ) : void Bind an event to closure
param ( String $index = null, Mixed $default = null, Array $source = null ) : Mixed Get request variables
path ( ) : Mixed Path helper method
pathToUrl ( $path ) : boolean | string
post ( String $path, Closure $callback, boolean $condition = true ) : void Bind POST request to route
registerModule ( $name, $dir )
render ( String $____template, Array $_____slots = [] ) : String Render view.
req_is ( String $type ) : boolean Request helper function
reroute ( String $path ) : void Redirect to path.
retrieve ( String $key, Mixed $default = null ) : Mixed Get a value from the Lime registry
route ( )
routeUrl ( String $path ) : String Returns link based on the route url of the app
run ( String $route = null ) : void Run Application
script ( String $src, $version = false ) : String Get script inc. markup
service ( String $name, Closure $callable ) : Object Returns a closure that stores the result of the given closure
set ( String $key, Mixed $value ) Put a value in the Lime registry
start ( String $name ) : Null Start block
stop ( $data = false ) stop application (exit)
style ( String $href, $version = false ) : String Get style inc. markup
trigger ( String $event, Array $params = [] ) : boolean Trigger event.

Защищенные методы

Метод Описание
bootModule ( $module )
render_route ( [type] $route, array $params = [] ) : String Render dispatched route

Описание методов

__construct() публичный Метод

Constructor
public __construct ( Array $settings = [] )
$settings Array initial registry settings

__get() публичный Метод

accces to services
public __get ( $name )

__invoke() публичный Метод

Invoke call
public __invoke ( $helper )

assets() публичный Метод

public assets ( $src, $version = false )

base() публичный Метод

public base ( $path )

baseUrl() публичный Метод

Returns link based on the base url of the app
public baseUrl ( String $path ) : String
$path String e.g. /js/myscript.js
Результат String Link

bind() публичный Метод

Bind request to route
public bind ( String $path, Closure $callback, boolean $condition = true ) : void
$path String
$callback Closure
$condition boolean
Результат void

bindClass() публичный Метод

Bind Class to routes
public bindClass ( String $class, $alias = false ) : void
$class String
Результат void

bindNamespace() публичный Метод

Bind namespace to routes
public bindNamespace ( String $namespace, $alias ) : void
$namespace String
Результат void

block() публичный Метод

Get block content
public block ( String $name, array $options = [] ) : String
$name String
$options array
Результат String

bootModule() защищенный Метод

protected bootModule ( $module )

cache() публичный Метод

Cache helper method
public cache ( ) : Mixed
Результат Mixed

decode() публичный Метод

Decode RC4 encrypted text
public decode ( [type] $data, [type] $pwd ) : [type]
$data [type]
$pwd [type]
Результат [type]

dispatch() публичный Метод

Dispatch route
public dispatch ( String $path ) : Mixed
$path String
Результат Mixed

encode() публичный Метод

RC4 encryption
public encode ( [type] $data, [type] $pwd, boolean $base64encoded = false ) : [type]
$data [type]
$pwd [type]
$base64encoded boolean [description]
Результат [type]

end() публичный Метод

End block
public end ( String $name ) : Null
$name String
Результат Null

escape() публичный Метод

Escape string.
public escape ( String $string, String $charset = null ) : String
$string String
$charset String
Результат String

get() публичный Метод

Bind GET request to route
public get ( String $path, Closure $callback, boolean $condition = true ) : void
$path String
$callback Closure
$condition boolean
Результат void

getClientIp() публичный Метод

Get client ip.
public getClientIp ( ) : String
Результат String

getClientLang() публичный Метод

Get client language
public getClientLang ( $default = "en" ) : String
Результат String

getSiteUrl() публичный Метод

Get site url
public getSiteUrl ( $withpath = false ) : String
Результат String

hash() публичный Метод

Create Hash
public hash ( $text, $algo = PASSWORD_BCRYPT ) : String
Результат String

helper() публичный Метод

public helper ( $helper )

instance() публичный статический Метод

Get App instance
public static instance ( String $name ) : Object
$name String Lime app name
Результат Object Lime app object

invoke() публичный Метод

Invoke Class as controller
public invoke ( String $class, String $action = "index", Array $params = [] ) : Mixed
$class String
$action String
$params Array
Результат Mixed

isAbsolutePath() публичный Метод

public isAbsolutePath ( $path )

isExit() публичный Метод

Is application stopped?
public isExit ( ) : boolean
Результат boolean

loadModules() публичный Метод

public loadModules ( $dirs, $autoload = true, $prefix = false )

module() публичный Метод

public module ( $name )

offsetExists() публичный Метод

public offsetExists ( $key )

offsetGet() публичный Метод

public offsetGet ( $key )

offsetSet() публичный Метод

Array Access implementation
public offsetSet ( $key, $value )

offsetUnset() публичный Метод

public offsetUnset ( $key )

on() публичный Метод

Bind an event to closure
public on ( String $event, Closure $callback, integer $priority ) : void
$event String
$callback Closure
$priority integer
Результат void

param() публичный Метод

Get request variables
public param ( String $index = null, Mixed $default = null, Array $source = null ) : Mixed
$index String
$default Mixed
$source Array
Результат Mixed

path() публичный Метод

Path helper method
public path ( ) : Mixed
Результат Mixed

pathToUrl() публичный Метод

public pathToUrl ( $path ) : boolean | string
$path
Результат boolean | string

post() публичный Метод

Bind POST request to route
public post ( String $path, Closure $callback, boolean $condition = true ) : void
$path String
$callback Closure
$condition boolean
Результат void

registerModule() публичный Метод

public registerModule ( $name, $dir )

render() публичный Метод

Render view.
public render ( String $____template, Array $_____slots = [] ) : String
$____template String Path to view
$_____slots Array Passed variables
Результат String Rendered view

render_route() защищенный Метод

Render dispatched route
protected render_route ( [type] $route, array $params = [] ) : String
$route [type]
$params array
Результат String

req_is() публичный Метод

Request helper function
public req_is ( String $type ) : boolean
$type String
Результат boolean

reroute() публичный Метод

Redirect to path.
public reroute ( String $path ) : void
$path String Path redirect to.
Результат void

retrieve() публичный Метод

Get a value from the Lime registry
public retrieve ( String $key, Mixed $default = null ) : Mixed
$key String
$default Mixed
Результат Mixed

route() публичный Метод

public route ( )

routeUrl() публичный Метод

Returns link based on the route url of the app
public routeUrl ( String $path ) : String
$path String e.g. /pages/home
Результат String Link

run() публичный Метод

Run Application
public run ( String $route = null ) : void
$route String Route to parse
Результат void

script() публичный Метод

Get script inc. markup
public script ( String $src, $version = false ) : String
$src String
Результат String

service() публичный Метод

Returns a closure that stores the result of the given closure
public service ( String $name, Closure $callable ) : Object
$name String
$callable Closure
Результат Object

set() публичный Метод

Put a value in the Lime registry
public set ( String $key, Mixed $value )
$key String Key name
$value Mixed Value

start() публичный Метод

Start block
public start ( String $name ) : Null
$name String
Результат Null

stop() публичный Метод

stop application (exit)
public stop ( $data = false )

style() публичный Метод

Get style inc. markup
public style ( String $href, $version = false ) : String
$href String
Результат String

trigger() публичный Метод

Trigger event.
public trigger ( String $event, Array $params = [] ) : boolean
$event String
$params Array
Результат boolean

Описание свойств

$apps защищенное статическое свойство

protected static $apps

$blocks защищенное свойство

protected $blocks

$events защищенное свойство

protected $events

$exit защищенное свойство

protected $exit

$helpers публичное свойство

public $helpers

$layout публичное свойство

public $layout

$mimeTypes публичное статическое свойство

* mime types
public static $mimeTypes

$paths защищенное свойство

protected $paths

$registry защищенное свойство

protected $registry

$response публичное свойство

public Response,lime|null $response
Результат Response | null

$routes защищенное свойство

protected $routes

$statusCodes публичное статическое свойство

* status codes
public static $statusCodes

$viewvars публичное свойство

* global view variables
public $viewvars