1. Go to this page and download the library: Download sixiaoqi/yaf-support 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/ */
sixiaoqi / yaf-support example snippets
$app = new Application([], realpath(dirname(__FILE__)));
Yaf_Registry::set('app', $app);
$app = new Application([], realpath(dirname(__FILE__)));
Yaf_Registry::set('app', $app);
app()['request'] = function ($c) {
return new Request('test/test', 'base_uri/test/test');
};
app()[Authenticate::class] = function ($c) {
return new Authenticate();
};
$app = new Application([], realpath(dirname(__FILE__)));
\Yaf_Registry::set('app', $app);
app()['request'] = function ($c) {
$request = new Request('test/test', 'base_uri/test/test');
$request->setShouldMethod('any');
$request->setMiddleware(['auth']);
$request->setParam('api_token','12345678');
return $request;
};
app()[Kernel::class] = function ($c) {
return new Kernel($c);
};
arrayConfig()->set('auth',