ServiceProvider
Service provider class for handling logic extending between a request's data and a response's behavior
package | Klein |
---|
__construct(\Klein\Request $request, \Klein\Response $response)
access | public |
---|
__get(string $key) : string
Allows the ability to arbitrarily request shared data from this instance while treating it as an instance property
access | public |
---|
string
The name of the shared data
string
__isset(string $key) : boolean
Allows the ability to arbitrarily check the existence of shared data from this instance while treating it as an instance property
access | public |
---|
string
The name of the shared data
boolean
__set(string $key, mixed $value) : void
Allows the ability to arbitrarily set shared data from this instance while treating it as an instance property
access | public |
---|
string
The name of the shared data
mixed
The value of the shared data
__unset(string $key) : void
Allows the ability to arbitrarily remove shared data from this instance while treating it as an instance property
access | public |
---|
string
The name of the shared data
addValidator(string $method, callable $callback) : void
access | public |
---|
string
The name of the validator method
callable
The callback to perform on validation
bind(\Klein\Request $request, \Klein\Response $response) : \Klein\ServiceProvider
access | public |
---|
escape(string $str) : void
static | |
---|---|
access | public |
string
The string to escape
flash(string $msg, string $type, array $params) : void
access | public |
---|
string
The message to flash
string
The flash message type
array
Optional params to be parsed by markdown
flashes(string $type) : array
access | public |
---|
string
The name of the flash message type
array
layout(string $layout) : string | \Klein\ServiceProvider
Simply calling this method without any arguments returns the current layout. Calling with an argument, however, sets the layout to what was provided by the argument.
access | public |
---|
string
The layout of the view
string
\Klein\ServiceProvider
markdown(string $str, array $args) : string
Supports basic markdown syntax
Also, this method takes in EITHER an array of optional arguments (as the second parameter) ... OR this method will simply take a variable number of arguments (after the initial str arg)
static | |
---|---|
access | public |
string
The text string to parse
array
Optional arguments to be parsed by markdown
string
partial(string $view, array $data) : void
access | public |
---|
string
The view to render
array
The data to render in the view
render(string $view, array $data) : void
access | public |
---|
string
The view to render
array
The data to render in the view
startSession() : string | false
This will start a session if the current session id is null
access | public |
---|
string
false
validate(string $string, string $err) : \Klein\Validator
access | public |
---|
string
The string to validate
string
The custom exception message to throw
validateParam(string $param, string $err) : \Klein\Validator
access | public |
---|
string
The name of the parameter to validate
string
The custom exception message to throw
yieldView() : void
access | public |
---|
$layout : string
access | protected |
---|
$request : \Klein\Request
access | protected |
---|
$response : \Klein\Response
access | protected |
---|
$session_id : string
access | protected |
---|
$shared_data : \Klein\DataCollection\DataCollection
access | protected |
---|
$view : string
access | protected |
---|