本文整理汇总了PHP中Zend_Config_Writer_Xml::render方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Config_Writer_Xml::render方法的具体用法?PHP Zend_Config_Writer_Xml::render怎么用?PHP Zend_Config_Writer_Xml::render使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Config_Writer_Xml
的用法示例。
在下文中一共展示了Zend_Config_Writer_Xml::render方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateFieldCollectionXml
/**
* @static
* @param Object_Class $class
* @return string
*/
public static function generateFieldCollectionXml($fieldCollection)
{
$FieldCollectionJson = Zend_Json::encode($fieldCollection);
$data = Zend_Json::decode($FieldCollectionJson);
unset($data["key"]);
$referenceFunction = function (&$value, $key) {
$value = htmlspecialchars($value);
};
array_walk_recursive($data, $referenceFunction);
$config = new Zend_Config($data, true);
$writer = new Zend_Config_Writer_Xml(array("config" => $config));
return $writer->render();
}
示例2: serialize
/**
*
* @param array $array
* @return string
*/
public static function serialize($array)
{
$config = new Zend_Config_Writer_Xml();
ZendT_Xml::encodeXml($array);
$config->setConfig(new Zend_Config($array));
$xml = $config->render();
return $xml;
/*$serializer = new XML_Serializer(array(XML_SERIALIZER_OPTION_ROOT_NAME=>'config'));
$result = $serializer->serialize($array);
if ($result){
$xml = $serializer->getSerializedData();
}
return $xml;*/
}
示例3:
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of 4worx nor the names of his contributors
* may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* @category Glitch
* @package Glitch_Controller
* @subpackage Dispatcher
* @author Dolf Schimmel (Freeaqingme) <dolf@enrise.com>
* @copyright 2011, Enrise
* @license http://www.opensource.org/licenses/bsd-license.php
*/
$config = new Zend_Config($data);
$xml = new Zend_Config_Writer_Xml(array('config' => $config));
return $xml->render();