How can I force assetic to render assets each time the page is reloaded?

后端 未结 4 535
别跟我提以往
别跟我提以往 2020-12-30 07:23

How can I force assetic to render assets each time the page is reloaded (no matter if assets are modified or not)?

More explanation about my issue:

I\'m curr

4条回答
  •  感情败类
    2020-12-30 07:41

    I'm using Assetic's Lessphp filter that caches files too. For myself I've created a class that extends default Assetic's filter and touches every file with current time

    getSourceRoot();
            $path = $asset->getSourcePath();
    
            $filename = realpath($root . '/' . $path);
    
            if (file_exists($filename)) {
                touch($filename);
            }
    
            parent::filterLoad($asset);
        }
    }
    

    And you must set "assetic.filter.lessphp.class" in your parameters section (services.yml):

    parameters:
        assetic.filter.lessphp.class: Xxx\AssetsBundle\Assetic\Filter\LessphpNonCachedFilter
    

提交回复
热议问题