{KO} - 3.4.3.1.4 load
load(string $path)
load(string $path)
이 메소드를 이용하면 특정 파일에서 설정 정보를 읽어올 수 있습니다.
// /app/config/messages.php:
<?php
$config['Company']['name'] = 'Pizza, Inc.';
$config['Company']['slogan'] = 'Pizza for your body and soul';
$config['Company']['phone'] = '555-55-55';
?>
<?php
Configure::load('messages');
Configure::read('Company.name');
?>
// /app/config/messages.php:<?php$config['Company']['name'] = 'Pizza, Inc.';$config['Company']['slogan'] = 'Pizza for your body and soul';$config['Company']['phone'] = '555-55-55';?><?phpConfigure::load('messages');Configure::read('Company.name');?>
모든 설정 키-값 짝은 파일 내의 $config 배열로 표현해야 합니다. load() 함수는 파일 내의 다른 변수들은 무시하게 됩니다.
{EN} - 3.4.3.1.4 load
load(string $path)
Use this method to load configuration information from a specific file.
// /app/config/messages.php:
<?php
$config['Company']['name'] = 'Pizza, Inc.';
$config['Company']['slogan'] = 'Pizza for your body and soul';
$config['Company']['phone'] = '555-55-55';
?>
<?php
Configure::load('messages');
Configure::read('Company.name');
?>
// /app/config/messages.php:<?php$config['Company']['name'] = 'Pizza, Inc.';$config['Company']['slogan'] = 'Pizza for your body and soul';$config['Company']['phone'] = '555-55-55';?><?phpConfigure::load('messages');Configure::read('Company.name');?>
Every configure key-value pair is represented in the file with the $config array. Any other variables in the file will be ignored by the load() function.
Differences
| Lines: 1-7 | Lines: 1-7 | ||
| <title>load</title> | <title>load</title> | ||
| - | <p class="method"><code>load(string $path)</code></p> <p>Use this method to load configuration information from a specific file.</p> |
+ | <pre>load(string $path)</pre> <p>이 메소드를 이용하면 특정 파일에서 설정 정보를 읽어올 수 있습니다.</p> |
| <pre> | <pre> | ||
| // /app/config/messages.php: | // /app/config/messages.php: | ||
| <?php | <?php | ||
| $config['Company']['name'] = 'Pizza, Inc.'; | $config['Company']['name'] = 'Pizza, Inc.'; | ||
| Lines: 13-17 | Lines: 13-17 | ||
| Configure::load('messages'); | Configure::load('messages'); | ||
| Configure::read('Company.name'); | Configure::read('Company.name'); | ||
| ?> | ?> | ||
| </pre> | </pre> | ||
| - | <p class="note">Every configure key-value pair is represented in the file with the <code>$config</code> array. Any other variables in the file will be ignored by the <code>load()</code> function.</p> | + | <p>모든 설정 키-값 짝은 파일 내의 $config 배열로 표현해야 합니다. load() 함수는 파일 내의 다른 변수들은 무시하게 됩니다.</p> |
