PHP code example of limingxinleo / swoft-aop-cacheable
1. Go to this page and download the library: Download limingxinleo/swoft-aop-cacheable 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/ */
limingxinleo / swoft-aop-cacheable example snippets
namespace SwoftTest\Testing\Bean;
use Swoft\Bean\Annotation\Bean;
use Swoftx\Aop\Cacheable\Annotation\Cacheable;
/**
* Class Demo
* @Bean
* @package SwoftTest\Testing\Bean
*/
class Demo
{
/**
*
* @author limx
* @Cacheable(key="output:{0}:{1}:{2}", ttl=36000)
* @param $name
* @return mixed
*/
public function output($name, $sex = 1, $msg = 'hello world')
{
return $name;
}