私のアプリケーションでは、次のようにcore.phpにconfigのような変数をすでに設定しています
core.php
$websetting = array(
'mydomain' => $_SERVER['HTTP_HOST'],
'adminEmail' => 'admin@xyz.com',
'supportEmail' => 'support@xyz.com',
'infoEmail' => 'info@xyz.com',
'accountEmail' => 'accounts@xyz.com',
'facebook' => 'facebook.com/xyz',
'twitter' => 'twitter.com/@xyz'
);
Configure::write('WebsiteSetting', $websetting);
ここで、webroot の cj に 1 つの morning.php ファイルを作成します。したがって、私のパスは次のようになります。webroot/cj/morning.php
morning.php で を読んでみますConfigure::read('WebsiteSetting.mydomain')
。
<?php
echo Configure::read('WebsiteSetting.mydomain');
?>
どうしたの :