【发布时间】:2013-11-27 02:46:56
【问题描述】:
我已通过关注this example 将我的应用程序设置为使用模块配置 xml。
现在我需要为一个配置键定义一个空数组。等效的 php 配置文件是:
<?php
return array (
//...the other configurations
'sample' => array(
'empty' => array()
)
);
我不知道如何在 xml 中构建它。 如果我尝试以下 xml,解析器会返回一个空字符串,但我需要一个空数组。
<?xml version="1.0" encoding="UTF-8"?>
<zend-config>
<!-- ...the other configurations -->
<sample>
<empty></empty>
</sample>
</zend-config>
是否有一个选项可以强制 Zend\Config\Factory 返回一个数组而不是一个字符串?
【问题讨论】:
标签: php zend-framework2 app-config configuration-files