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 |
|---|
stringThe 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 |
|---|
stringThe 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 |
|---|
stringThe name of the shared data
mixedThe 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 |
|---|
stringThe name of the shared data
addValidator(string $method, callable $callback) : void
| access | public |
|---|
stringThe name of the validator method
callableThe callback to perform on validation
bind(\Klein\Request $request, \Klein\Response $response) : \Klein\ServiceProvider
| access | public |
|---|
escape(string $str) : void
| static | |
|---|---|
| access | public |
stringThe string to escape
flash(string $msg, string $type, array $params) : void
| access | public |
|---|
stringThe message to flash
stringThe flash message type
arrayOptional params to be parsed by markdown
flashes(string $type) : array
| access | public |
|---|
stringThe name of the flash message type
arraylayout(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 |
|---|
stringThe 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 |
stringThe text string to parse
arrayOptional arguments to be parsed by markdown
stringpartial(string $view, array $data) : void
| access | public |
|---|
stringThe view to render
arrayThe data to render in the view
render(string $view, array $data) : void
| access | public |
|---|
stringThe view to render
arrayThe data to render in the view
startSession() : string | false
This will start a session if the current session id is null
| access | public |
|---|
stringfalse
validate(string $string, string $err) : \Klein\Validator
| access | public |
|---|
stringThe string to validate
stringThe custom exception message to throw
validateParam(string $param, string $err) : \Klein\Validator
| access | public |
|---|
stringThe name of the parameter to validate
stringThe 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 |
|---|