Files
vij/src/createblock.php
arlemp@selectel.ru dfcd1458ab add cache blocks
2021-11-03 00:08:16 +03:00

26 lines
354 B
PHP

<?php
function create_block($block){
$blockfile = BASE_VIJ.'blocks/'.$blockpath.$block.'.php';
if (!file_exists($blockfile))
return false;
$cachefile = VIJ_CACHE.$block.'.html';
ob_start();
include $blockfile;
$html = ob_get_contents();
ob_end_clean();
return file_put_contents($cachefile, $html);
}