yii

Force Yii to republish assets every page refresh

During webapp development you’ll need often assets republication. When you publish assets using directory path, framework won’t republish them automaticaly. So what can you do? It’s plain simple. Use YII_DEBUG constant as fourth argument in publish function.

$assetPath = Yii::app()->assetManager->publish(Yii::getPathOfAlias('application.modules.components.assets'), false, 1, YII_DEBUG);

From this moment Yii will republish assets on every page refresh only in debug mode (it won’t consume your resources in production mode).

Published by

Konrad Fedorczyk

Konrad Fedorczyk

I'm interested in programming and gamedev. I especially luv HTML5 and everything connected to web technologies.

3 thoughts on “Force Yii to republish assets every page refresh”

Leave a Reply

Your email address will not be published. Required fields are marked *