本文整理匯總了PHP中Json::getArrayData方法的典型用法代碼示例。如果您正苦於以下問題:PHP Json::getArrayData方法的具體用法?PHP Json::getArrayData怎麽用?PHP Json::getArrayData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Json
的用法示例。
在下文中一共展示了Json::getArrayData方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: loadData
protected function loadData($autoloadFile, $returns = array())
{
if (file_exists($autoloadFile)) {
$content = $this->getFileManager()->getContents($autoloadFile);
$arrayContent = Json::getArrayData($content);
if (!empty($arrayContent)) {
return $arrayContent;
}
$GLOBALS['log']->error('Autoload::unify() - Empty file or syntax error - [' . $autoloadFile . ']');
}
return $returns;
}
示例2: getAddData
protected function getAddData($currData, $routeFile)
{
if (file_exists($routeFile)) {
$content = $this->getFileManager()->getContents($routeFile);
$arrayContent = Json::getArrayData($content);
if (empty($arrayContent)) {
$GLOBALS['log']->error('Route::unify() - Empty file or syntax error - [' . $routeFile . ']');
return $currData;
}
$currData = $this->addToData($currData, $arrayContent);
}
return $currData;
}
示例3: merge
/**
* Merge layout data
* Ex. $scope= Account, $name= detail then will be created a file layoutFolder/Account/detail.json
*
* @param JSON string $data
* @param string $scope - ex. Account
* @param string $name - detail
*
* @return bool
*/
public function merge($data, $scope, $name)
{
$scope = $this->sanitizeInput($scope);
$name = $this->sanitizeInput($name);
$prevData = $this->get($scope, $name);
$prevDataArray = Json::getArrayData($prevData);
$dataArray = Json::getArrayData($data);
$data = Util::merge($prevDataArray, $dataArray);
$data = Json::encode($data);
return $this->set($data, $scope, $name);
}
示例4: merge
/**
* Merge layout data
* Ex. $controller= Account, $name= detail then will be created a file layoutFolder/Account/detail.json
*
* @param JSON string $data
* @param string $controller - ex. Account
* @param string $name - detail
*
* @return bool
*/
public function merge($data, $controller, $name)
{
$prevData = $this->get($controller, $name);
$prevDataArray = Json::getArrayData($prevData);
$dataArray = Json::getArrayData($data);
$data = Util::merge($prevDataArray, $dataArray);
$data = Json::encode($data);
return $this->set($data, $controller, $name);
}