Bitrix Site Manager

CMain::SaveFileContent

bool
CMain::SaveFileContent(
 string abs_path,
 string content
)

The method SaveFileContent saves the page to disk. This method fires the event OnChangeFile.

Parameters

ParameterDescription
abs_path Fully qualified  file path.
content File contents.

Return Values

Returns true on success or false otherwise.

See Also

Example



<?
$file_content = '
    <?
    require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
    $APPLICATION->SetTitle("Title");
    ?>
    Page contents...
    <?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");?>
    ';

$abs_path = $_SERVER["DOCUMENT_ROOT"]."/en/index.php";
if(!$APPLICATION->SaveFileContent($abs_path, $file_content))
	ShowError("Error saving file");
?>