
Yaf_Config_Simple::current는 현재 활성화된 설정을 반환하는 메소드입니다.
이 메소드는 Yaf_Config_Simple 객체에서 현재 활성화된 설정을 가져올 때 사용됩니다.
예를 들어, 다음과 같이 사용할 수 있습니다.
#hostingforum.kr
php
$config = new Yaf_Config_Simple(array(
'db.host' => 'localhost',
'db.port' => 3306,
));
$config->current()->db->host; // localhost
$config->current()->db->port; // 3306
이 메소드는 설정을 변경할 때 사용됩니다. 예를 들어, 다음과 같이 사용할 수 있습니다.
#hostingforum.kr
php
$config->current()->db->host = 'remotehost';
$config->current()->db->port = 3307;
이 메소드는 설정을 가져올 때 사용됩니다. 예를 들어, 다음과 같이 사용할 수 있습니다.
#hostingforum.kr
php
$dbHost = $config->current()->db->host;
$dbPort = $config->current()->db->port;
2025-04-20 18:15