次のように、config.phpとconfignw.phpの2つのPHPファイルがあります。
config.php
$html = array(
[update_item_in_store] => Array
(
[header] => default_header.php
[body] => update_item_in_store.php
[footer] => default_footer.php
)
[user_followed] => Array
(
[header] => default_header.php
[body] => user_followed.php
[footer] => default_footer.php
)
[updated_account_settings] => Array
(
[header] => default_header.php
[body] => updated_account_settings.php
[footer] => default_footer.php
)
);
$cml = array
(
"default_header",
"default_body",
"default_footer"
);
confignw.php
$html = array(
[add_item_in_store] => Array
(
[header] => default_header.php
[body] => add_item_in_store.php
[footer] => default_footer.php
)
[user_followed] => Array
(
[header] => default_header.php
[body] => user_followed_new.php
[footer] => default_footer.php
)
);
$cml = array
(
"default_skeleton"
);
そして、両方のファイルはcommon.phpと呼ばれるファイルに含まれています。
そして、結果は次のように両方のマージとして来るはずです、
期待される結果:
$html = array(
[update_item_in_store] => Array
(
[header] => default_header.php
[body] => update_item_in_store.php
[footer] => default_footer.php
)
[user_followed] => Array
(
[header] => default_header.php
[body] => user_followed_new.php
[footer] => default_footer.php
)
[updated_account_settings] => Array
(
[header] => default_header.php
[body] => updated_account_settings.php
[footer] => default_footer.php
)
[add_item_in_store] => Array
(
[header] => default_header.php
[body] => add_item_in_store.php
[footer] => default_footer.php
)
);
$cml = array
(
"default_header",
"default_body",
"default_footer",
"default_skeleton"
);
ファイル内の配列から両方の配列に追加された値をconfignw.php
確認し、$ html[user_followed][body]が変更されていることに注意してください。しかし、何が起こっているのかというと、2番目のファイルの値だけが来ています。では、この期待される結果をどのように達成するのでしょうか?任意のアイデアや提案を歓迎します...