Quick'n'dirty cache with convenience method Example: $cache->get('message', function() { return 'Hello World'; }); Will return the message from cache if present and will generate it by executing the callback and store it in the cache before returning the value.
Автор: Fabrizio Branca
Пример #1
0
 public function getTemplate()
 {
     return $this->cache->get(__METHOD__, function () {
         $res = $this->cfnClient->getTemplate(['StackName' => $this->getName()]);
         return $res->get('TemplateBody');
     });
 }