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


PHP Dict::get方法代碼示例

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


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

示例1: xdrRetriveData

 /**
  * This function evaluates a datapath relativ to the given dataset.
  *
  * @param string $strDataPath The XML data path
  * @param Xml $mxtDataset The dataset on which the datapath should be applied
  * @param bool $bolStringOnly If true, the function will only return results of type string
  * @param bool $bolStrict If strict mode is of, the function will try to convert unfitting object to strings (e.g. XML files)
  * @return string|array|Xml|mixed
  */
 private function xdrRetriveData($strDataPath, $mxtDataset, $bolStringOnly = true, $bolStrict = false)
 {
     // TESTING: $this->probe('xdrRetriveData', "STEP3: Evaluating datapath", 7);
     // TESTING: $this->probe('xdrRetriveData', "Only Strings: ".($bolStringOnly?'on':'off'), 7);
     // TESTING: $this->probe('xdrRetriveData', "Path: ".$strDataPath, 7);
     if (is_array($mxtDataset)) {
         // TESTING: $this->probe('xdrRetriveData', "Dataset is an array", 8);
         $xlyArray = new Dict($mxtDataset);
         return $xlyArray->get($strDataPath, false);
     } elseif ($mxtDataset instanceof Xml || $mxtDataset instanceof Bean) {
         // TESTING: $this->probe('xdrRetriveData', "Dataset is an XML/Bean document", 8);
         if ($bolStringOnly) {
             // TESTING: $this->probe('xdrRetriveData', "Tracing the datapath now: ".$strDataPath, 9);
             return $mxtDataset->trace($strDataPath);
         } else {
             // TESTING: $this->probe('xdrRetriveData', "Retrieving the object now: ".$strDataPath, 9);
             $mxtData = $mxtDataset->getNodesByPath($strDataPath);
             if (isset($mxtData[1])) {
                 return $mxtData;
             } elseif (isset($mxtData[0])) {
                 return $mxtData[0];
             } else {
                 return false;
             }
         }
     } else {
         // TESTING: $this->probe('xdrRetriveData', "Invalid dataset: Dataset must be an array or XML/Bean object.", 8);
         return false;
     }
 }
開發者ID:dapepe,項目名稱:xily,代碼行數:39,代碼來源:Bean.php

示例2: array

<?php

return array('driver' => 'mailgun', 'host' => 'smtp.mailgun.org', 'port' => 587, 'from' => array('address' => \Dict::get('email_from_email'), 'name' => \Dict::get('email_from_name', 'CMS')), 'encryption' => 'tls', 'username' => null, 'password' => null, 'sendmail' => '/usr/sbin/sendmail -bs', 'pretend' => false);
開發者ID:joadr,項目名稱:cms,代碼行數:3,代碼來源:mail.php

示例3: getOneDict

 private function getOneDict($identifier, $default)
 {
     return \Dict::get($identifier, $default);
 }
開發者ID:joadr,項目名稱:cms,代碼行數:4,代碼來源:Engine.php

示例4: array

<?php

return array('mailgun' => array('domain' => \Dict::get('mailgun_domain'), 'secret' => \Dict::get('mailgun_secret')), 'mandrill' => array('secret' => ''), 'stripe' => array('model' => 'User', 'secret' => ''));
開發者ID:joadr,項目名稱:cms,代碼行數:3,代碼來源:services.php


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