當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Config_Xml::setExtend方法代碼示例

本文整理匯總了PHP中Zend_Config_Xml::setExtend方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Config_Xml::setExtend方法的具體用法?PHP Zend_Config_Xml::setExtend怎麽用?PHP Zend_Config_Xml::setExtend使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend_Config_Xml的用法示例。


在下文中一共展示了Zend_Config_Xml::setExtend方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: saveAction

 public function saveAction()
 {
     $this->_helper->layout()->setLayout("nolayout");
     $modelname = $this->_request->getParam("model", 'Eau_Model_Company');
     $suffixname = "model-config.xml";
     $modelnameAr = explode("_", $modelname);
     $packet = strtolower($modelnameAr[0]);
     $configfile = $packet . "-" . $suffixname;
     $config = new Zend_Config_Xml(CONFIG_PATH . "{$configfile}", null, true);
     $allfield = array();
     $arrayKey = array();
     $i = 0;
     foreach (App_Model_Config::get($modelname)->getProperties() as $element) {
         $allfield[] = $element->name;
         $arrayKey[$element->name] = $i++;
     }
     $config->production->classes->{$modelname}->text = "2";
     $props = $config->production->classes->{$modelname}->prop->toArray();
     foreach ($_POST as $key => $value) {
         list($field, $property) = explode("_", $key);
         if (in_array($field, $allfield)) {
             $index = $arrayKey[$field];
             foreach ($props as $key => $prop) {
                 if ($prop['name'] == $field) {
                     $props[$key][$property] = $value;
                     //$config->classes->{$modelname}->props->$field->$property = $value;
                 }
                 //echo $prop->name,"<br/>";
             }
             //$config->classes->{$modelname}->prop->$property = $value;
         }
     }
     $config->production->classes->{$modelname}->prop = $props;
     $config->staging = array();
     $config->setExtend('staging', 'production');
     $config->development = array();
     $config->setExtend('development', 'production');
     $writer = new Zend_Config_Writer_Xml();
     $writer->write(CONFIG_PATH . $configfile, $config);
     $this->render('blank', null, true);
 }
開發者ID:hugi2002,項目名稱:mylibrary,代碼行數:41,代碼來源:FormSettingController.php


注:本文中的Zend_Config_Xml::setExtend方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。