generateFileUsingSimpleTemplate의 변환 규칙 변경

This commit is contained in:
2018-03-17 22:08:34 +09:00
parent 7f885f7a69
commit 96e4c08ee9
4 changed files with 26 additions and 26 deletions
+2 -2
View File
@@ -150,7 +150,7 @@ function hashPassword($salt, $password){
}
/**
* 변환할 내용이 _key_ 형태로 작성된 단순한 템플릿 파일을 이용하여 결과물을 생성해주는 함수.
* 변환할 내용이 _tK_$key_ 형태로 작성된 단순한 템플릿 파일을 이용하여 결과물을 생성해주는 함수.
*/
function generateFileUsingSimpleTemplate(string $srcFilePath, string $destFilePath, array $params, bool $canOverwrite=false){
if($destFilePath === $srcFilePath){
@@ -168,7 +168,7 @@ function generateFileUsingSimpleTemplate(string $srcFilePath, string $destFilePa
$text = file_get_contents($srcFilePath);
foreach($params as $key => $value){
$text = str_replace("_{$key}_", $value);
$text = str_replace("_tK_{$key}_", $value);
}
file_put_contents($destFilePath, $text);