1. Go to this page and download the library: Download yzh52521/symfony-cache 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/ */
yzh52521 / symfony-cache example snippets
composer
namespace app\controller;
use support\Request;
use yzh52521\SymfonyCache\Cache;
class UserController
{
public function db(Request $request)
{
$key = 'test_key';
Cache::set($key, rand());
return response(Cache::get($key));
}
}