diff --git a/DataCollector/CacheCollector.php b/DataCollector/CacheCollector.php index 907fcf8..13f957e 100644 --- a/DataCollector/CacheCollector.php +++ b/DataCollector/CacheCollector.php @@ -41,8 +41,7 @@ public function collect(Request $request, Response $response, \Exception $except /** @var Client $client */ $cacheClient = $this->cache->getClient(); - foreach ($cacheClient->getIndex() as $key => $item){ - + foreach ($cacheClient->getIndex() as $key => $item) { $data = unserialize($item); $size = $size + $data['size']; @@ -89,4 +88,4 @@ public function getName() { return 'in_memory_list_data_collector'; } -} \ No newline at end of file +} diff --git a/DependencyInjection/InMemoryListExtension.php b/DependencyInjection/InMemoryListExtension.php index 9d4894e..6a0a46d 100644 --- a/DependencyInjection/InMemoryListExtension.php +++ b/DependencyInjection/InMemoryListExtension.php @@ -25,7 +25,7 @@ public function load(array $configs, ContainerBuilder $container) // Includes services_dev.yml only // if we are in debug mode - if(in_array($container->getParameter('kernel.environment'), ['dev', 'test'])){ + if (in_array($container->getParameter('kernel.environment'), ['dev', 'test'])) { $loader->load('services_dev.yml'); } @@ -36,4 +36,4 @@ public function load(array $configs, ContainerBuilder $container) // set Symfony parameter called 'in_memory_list' $container->setParameter('in_memory_list', $config); } -} \ No newline at end of file +} diff --git a/InMemoryListBundle.php b/InMemoryListBundle.php index c34e3b9..9ada81e 100644 --- a/InMemoryListBundle.php +++ b/InMemoryListBundle.php @@ -14,5 +14,5 @@ class InMemoryListBundle extends Bundle { - const VERSION = '1.0.0'; + const VERSION = '1.0.1'; } diff --git a/README.md b/README.md index 7146d4f..40bdb37 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,18 @@ public function indexAction(Request $request) ]); } ``` + +To loop data in your twig files you can use `item` function; + +```twig +{% for list in cachedList %} +