PHP code example of zenstruck / cache-bundle

1. Go to this page and download the library: Download zenstruck/cache-bundle 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/ */

    

zenstruck / cache-bundle example snippets


    // app/AppKernel.php

    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Zenstruck\CacheBundle\ZenstruckCacheBundle(),
        );
        // ...
    }
    

    use Zenstruck\CacheBundle\Url\UrlProvider;

    namespace Acme;

    class MyUrlProvider implements UrlProvider
    {
        public function getUrls()
        {
            $urls = array();

            // fetch from a datasource

            return $urls;
        }

        public function count()
        {
            return count($this->getUrls());
        }
    }