How to update a file in a create event or izmeneniia element of the InfoBlock?

Good time of day !

There is a component (news.list), which displays the slider on the home. Through the admin panel you can set the styles for the slider, this result_modifier there is such code:

$arPropValues = array();
$dbItems = CIBlockElement::GetList(array(), array('IBLOCK_ID' => 8, 'ACTIVE' => 'Y'), array('PROPERTY_DEFAULTSLIDER_CSS')); 
while($arItem = $dbItems->GetNext(true, false)) { 
$path = $_SERVER['DOCUMENT_ROOT'].'/local/templates/zemtrad/css/getindexslide.css';
file_put_contents($path, $arPropValues["0"]);

But the problem is that it is not updated and the styles don't work until you manually do not update the file. Tell me how to do so if the file was updated when you change the element of the InfoBlock
April 7th 20 at 15:28

Find more questions by tags PHP