本文整理匯總了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;
}
}
示例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);
示例3: getOneDict
private function getOneDict($identifier, $default)
{
return \Dict::get($identifier, $default);
}
示例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' => ''));