Maslosoft Staple API
Class CallbackExtractor
Callback Extractor
This can be used to pass data from other php scripts.
By default Callback Extractor is disabled, as it need to have configured callback to do anything.
Example configuration with anonymous function:
$staple->preProcessors[] = [ 'class' => CallbackExtractor::class, 'callback' => function($owner, $filename, $view){ return ['message' => 'Hello World!'] } ];
This will result in variable $data->message
available in both view and template.
Multiple Callback Extractors can be used to call different callbacks.
- Maslosoft\Staple\Processors\Pre\CallbackExtractor implements Maslosoft\Staple\Interfaces\PreProcessorInterface
Namespace: Maslosoft\Staple\Processors\Pre
Author: Piotr Maselkowski
Located at Processors/Pre/CallbackExtractor.php
Author: Piotr Maselkowski
Located at Processors/Pre/CallbackExtractor.php
Methods summary
public
|
|
public
|
API documentation generated by ApiGen