HTMLページを生成し、各ページを保存するファイルを作成するcmsを作りたいです。
理想的には、次のようなものが必要です。
<?php
$file1 = get_produced_html_from('mainPage.php');
/* write the file to a directory*/
$file2 = get_produced_html_from('ProductsPage.php');
/* write the file to a directory*/
?>
require、include、require_once、include_onseなどの代わりに見逃した関数はありますか?
明確にするために: .php ファイル内に php コードは必要ありません。html コンテンツのみが必要です。つまり、php ファイルを最初に実行する必要があります。
解決策は、 http://domain.com/templates/mainPage.phpを HTML ストリームとして読み取ってhttp://php.net/manual/en/function.file-get-contents.phpを使用するようなものだと思いますか?
本当にありがとうございました。