public function onPreRenderPage(RendererEvent $event)
    {
        // Checks if page caching is available
        $this->object = $event->getTarget();

        if (false === ($this->object instanceof Page) || false === $this->checkCachePageEvent()) {
            return;
        }

        // Checks if cache data is available
        $cache_id = $this->getPageCacheId();
        if (false === $data = $this->cache_page->load($cache_id)) {
            return;
        }

        $renderer = $event->getRenderer();
        $renderer->setRender($data);
        $event->getDispatcher()->dispatch('cache.postrender', new Event($this->object, array($renderer, $data)));
        $this->application->debug(sprintf(
            'Found cache (id: %s) for rendering `%s(%s)` with mode `%s`.',
            $cache_id,
            get_class($this->object),
            $this->object->getUid(),
            $renderer->getMode()
        ));
    }
public function onPreRenderPage(RendererEvent $event)
    {
        // Checks if page caching is available
        $this->object = $event->getTarget();

        if (false === ($this->object instanceof Page) || false === $this->checkCachePageEvent()) {
            return;
        }

        // Checks if cache data is available
        $cache_id = $this->getPageCacheId();
        if (false === $data = $this->cache_page->load($cache_id)) {
            return;
        }

        $renderer = $event->getRenderer();
        $renderer->setRender($data);
        $event->getDispatcher()->dispatch('cache.postrender', new Event($this->object, array($renderer, $data)));
        $this->application->debug(sprintf(
            'Found cache (id: %s) for rendering `%s(%s)` with mode `%s`.',
            $cache_id,
            get_class($this->object),
            $this->object->getUid(),
            $renderer->getMode()
        ));
    }
public function onPreRenderPage ( RendererEvent $ event ) { // Checks if page caching is available $ this -> object = $ event -> getTarget ( ) ; if ( false === ( $ this -> object instanceof Page ) || false === $ this -> checkCachePageEvent ( ) ) { return ; } // Checks if cache data is available $ cache_id = $ this -> getPageCacheId ( ) ; if ( false === $ data = $ this -> cache_page -> load ( $ cache_id ) ) { return ; } $ renderer = $ event -> getRenderer ( ) ; $ renderer -> setRender ( $ data ) ; $ event -> getDispatcher ( ) -> dispatch ( 'cache.postrender' , new Event ( $ this -> object , array ( $ renderer , $ data ) ) ) ; $ this -> application -> debug ( sprintf ( 'Found cache (id: %s) for rendering `%s(%s)` with mode `%s`.' , $ cache_id , get_class ( $ this -> object ) , $ this -> object -> getUid ( ) , $ renderer -> getMode ( ) ) ) ; }
Looks for available cached data before rendering a page.

@param \BackBee\Event\Event $event
Looks for available cached data before rendering a page .