Bundle/CoreBundle/Listener/ViewCssListener.php
public function onRenderPage(PageRenderEvent $event)
    {
        $currentView = $event->getCurrentView();

        if ($currentView instanceof VirtualBusinessPage) {
            $currentView->setCssHash($currentView->getTemplate()->getCssHash());
        } elseif (!$currentView->getCssHash() || !$currentView->isCssUpToDate()) {

            //CSS file will be regenerated during WidgetSubscriber onFlush event
            $currentView->changeCssHash();
            $this->entityManager->persist($currentView);
            $this->entityManager->flush($currentView);
        }
    }
public function onRenderPage(PageRenderEvent $event)
    {
        $currentView = $event->getCurrentView();

        if ($currentView instanceof VirtualBusinessPage) {
            $currentView->setCssHash($currentView->getTemplate()->getCssHash());
        } elseif (!$currentView->getCssHash() || !$currentView->isCssUpToDate()) {

            //CSS file will be regenerated during WidgetSubscriber onFlush event
            $currentView->changeCssHash();
            $this->entityManager->persist($currentView);
            $this->entityManager->flush($currentView);
        }
    }
public function onRenderPage ( PageRenderEvent $ event ) { $ currentView = $ event -> getCurrentView ( ) ; if ( $ currentView instanceof VirtualBusinessPage ) { $ currentView -> setCssHash ( $ currentView -> getTemplate ( ) -> getCssHash ( ) ) ; } elseif ( ! $ currentView -> getCssHash ( ) || ! $ currentView -> isCssUpToDate ( ) ) { //CSS file will be regenerated during WidgetSubscriber onFlush event $ currentView -> changeCssHash ( ) ; $ this -> entityManager -> persist ( $ currentView ) ; $ this -> entityManager -> flush ( $ currentView ) ; } }
Generate cssHash and css file for current View if cssHash has not been set yet or is not up to date.

@param PageRenderEvent $event

@throws \Exception
Generate cssHash and css file for current View if cssHash has not been set yet or is not up to date .