Documentation

SaveFileContent

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

The method saves the page to disk. Returns true on success and false otherwise. This method fires the OnChangeFile event. Non-static method.

Parameters

ParameterDescription
abs_path Full path to the file on disk.
content File content.

See Also

Examples of use

<?
$file_content = '
    <?
    require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
    $APPLICATION->SetTitle("Title");
    ?>
    Page content...
    <?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");
?>


© «Bitrix24», 2001-2024