本文整理汇总了PHP中Braintree_Util::camelCaseToDelimiterArray方法的典型用法代码示例。如果您正苦于以下问题:PHP Braintree_Util::camelCaseToDelimiterArray方法的具体用法?PHP Braintree_Util::camelCaseToDelimiterArray怎么用?PHP Braintree_Util::camelCaseToDelimiterArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Braintree_Util
的用法示例。
在下文中一共展示了Braintree_Util::camelCaseToDelimiterArray方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: connectUrl
public function connectUrl($params = array())
{
$query = Braintree_Util::camelCaseToDelimiterArray($params, '_');
$query['client_id'] = $this->_config->getClientId();
$url = $this->_config->baseUrl() . '/oauth/connect?' . http_build_query($query);
return $this->signUrl($url);
}
示例2: connectUrl
public function connectUrl($params = array())
{
$query = Braintree_Util::camelCaseToDelimiterArray($params, '_');
$query['client_id'] = $this->_config->getClientId();
$queryString = preg_replace('/\\%5B\\d+\\%5D/', '%5B%5D', http_build_query($query));
$url = $this->_config->baseUrl() . '/oauth/connect?' . $queryString;
return $this->signUrl($url);
}
示例3: put
public function put($path, $params = null)
{
$body = http_build_query(Braintree_Util::camelCaseToDelimiterArray($params, '_'));
$response = $this->_doRequest('PUT', $path, $body);
$responseCode = $response['status'];
if ($responseCode === 200 || $responseCode === 201 || $responseCode === 422 || $responseCode === 400) {
return Braintree_Util::delimiterToCamelCaseArray(json_decode($response['body'], true), '_');
} else {
Braintree_Util::throwStatusCodeException($responseCode);
}
}
示例4: arrayToXml
/**
* arrays passed to this method should have a single root element
* with an array as its value
* @param array $aData the array of data
* @return var XML string
*/
public static function arrayToXml($aData)
{
$aData = Braintree_Util::camelCaseToDelimiterArray($aData, '-');
// set up the XMLWriter
$writer = new XMLWriter();
$writer->openMemory();
$writer->setIndent(true);
$writer->setIndentString(' ');
$writer->startDocument('1.0', 'UTF-8');
// get the root element name
$aKeys = array_keys($aData);
$rootElementName = $aKeys[0];
// open the root element
$writer->startElement($rootElementName);
// create the body
self::_createElementsFromArray($writer, $aData[$rootElementName], $rootElementName);
// close the root element and document
$writer->endElement();
$writer->endDocument();
// send the output as string
return $writer->outputMemory();
}