本文整理匯總了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();