Example 119. Using Zend_Config_Yaml with sfYaml
As noted in the options
section, Zend_Config_Yaml allows you to specify an
alternate YAML parser at instantiation.
sfYaml is a Symfony component that
implements a complete YAML parser in PHP, and includes a number of additional
features including the ability to parse PHP expressions embedded in the YAML. In
this example, we use the sfYaml::load() method as our YAML
decoder callback. (Note: this assumes that the
sfYaml class is either already loaded or available via
autoloading.)
<?php
$config = new Zend_Config_Yaml(
APPLICATION_PATH . '/configs/application.yaml',
APPLICATION_ENV,
array('yaml_decoder' => array('sfYaml', 'load'))
);




