{KO} - 3.4.3.1.2 read

read(string $key = 'debug')
  1. read(string $key = 'debug')

응용 프로그램의 설정 데이터를 읽어오는 데 쓰입니다. 키를 생략하면 CakePHP에서 상당히 중요한 debug 값을 읽어옵니다. 키를 주면 데이터를 얻을 수 있습니다. 앞서의 write() 예제를 이용하자면 다음과 같은 식으로 그 데이터를 다시 읽어올 수 있습니다.

Configure::read('Company.name');    //결과값: 'Pizza, Inc.'
Configure::read('Company.slogan');  //결과값: 'Pizza for your body and soul'
 
Configure::read('Company');
 
//결과값: 
array('name' => 'Pizza, Inc.', 'slogan' => 'Pizza for your body and soul');
  1. Configure::read('Company.name'); //결과값: 'Pizza, Inc.'
  2. Configure::read('Company.slogan'); //결과값: 'Pizza for your body and soul'
  3. Configure::read('Company');
  4. //결과값:
  5. array('name' => 'Pizza, Inc.', 'slogan' => 'Pizza for your body and soul');

{EN} - 3.4.3.1.2 read

read(string $key = 'debug')

Used to read configuration data from the application. Defaults to CakePHP’s important debug value. If a key is supplied, the data is returned. Using our examples from write() above, we can read that data back:

Configure::read('Company.name');    //yields: 'Pizza, Inc.'
Configure::read('Company.slogan');  //yields: 'Pizza for your body and soul'
 
Configure::read('Company');
 
//yields: 
array('name' => 'Pizza, Inc.', 'slogan' => 'Pizza for your body and soul');
  1. Configure::read('Company.name'); //yields: 'Pizza, Inc.'
  2. Configure::read('Company.slogan'); //yields: 'Pizza for your body and soul'
  3. Configure::read('Company');
  4. //yields:
  5. array('name' => 'Pizza, Inc.', 'slogan' => 'Pizza for your body and soul');

Differences

Lines: 1-12Lines: 1-12
 <title>read</title> <title>read</title>
-<p class="method"><code>read(string $key = 'debug')</code></p>
<p>Used to read configuration data from the application. Defaults to CakePHP’s important debug value. If a key is supplied, the data is returned. Using our examples from write() above, we can read that data back:</p>
+<pre>read(string $key = 'debug')</pre>
<p>응용 프로그램의 설정 데이터를 읽어오는 쓰입니다. 키를 생략하면 CakePHP에서 상당히 중요한 debug 값을 읽어옵니다. 키를 주면 데이터를 얻을 있습니다. 앞서의 write() 예제를 이용하자면 다음과 같은 식으로 그 데이터를 다시 읽어올 수 있습니다.</p>
 <pre> <pre>
-Configure::read('Company.name'); //yields: 'Pizza, Inc.'
Configure::read('Company.slogan'); //yields: 'Pizza for your body and soul'
+Configure::read('Company.name'); //결과값: 'Pizza, Inc.'
Configure::read('Company.slogan'); //결과값: 'Pizza for your body and soul'
   
 Configure::read('Company'); Configure::read('Company');
   
-//yields:
array('name' =&amp;gt; 'Pizza, Inc.', 'slogan' =&amp;gt; 'Pizza for your body and soul');
+//결과값:
array('name' => 'Pizza, Inc.', 'slogan' => 'Pizza for your body and soul');
 </pre> </pre>