PHP code example of klein0r / slim-alfred-renderer
1. Go to this page and download the library: Download klein0r/slim-alfred-renderer library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
klein0r / slim-alfred-renderer example snippets
use Slim\Views\ScriptFilterRenderer;
$app->getContainer();
$container['alfredRenderer'] = new ScriptFilterRenderer();
$app->get('/hello/{name}', function ($request, $response, $args) {
$data = [
[
'uid' => '35345345u2938475h',
'arg' => 'argument1',
'title' => 'thetitle',
'subtitle' => 'thesubtitle',
'icon' => 'icon.png',
'valid' => 'yes'
]
];
return $this->alfredRenderer->render($response, $data);
});
$app->run();