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


PHP Arr::sortRecursive方法代碼示例

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


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

示例1: index

 public function index()
 {
     Audit::log(Auth::user()->id, trans('admin/settings/general.audit-log.category'), trans('admin/settings/general.audit-log.msg-index'));
     $page_title = trans('admin/settings/general.page.index.title');
     // "Admin | Settings";
     $page_description = trans('admin/settings/general.page.index.description');
     // "List of Settings";
     //        $settings = (new SettingModel())->all();
     $settings = Setting::all();
     $settings = Arr::dot($settings);
     $settingsFiltered = Utils::FilterOutUserSettings($settings);
     $settingsFiltered = Arr::sortRecursive($settingsFiltered);
     return view('admin.settings.index', compact('settingsFiltered', 'page_title', 'page_description'));
 }
開發者ID:sroutier,項目名稱:laravel-5.1-enterprise-starter-kit,代碼行數:14,代碼來源:SettingsController.php

示例2:

 /**
  * Recursively sort an array by keys and values.
  *
  * @param  array $array
  * @return array
  */
 function array_sort_recursive($array)
 {
     return Arr::sortRecursive($array);
 }
開發者ID:saj696,項目名稱:pipe,代碼行數:10,代碼來源:helpers.php

示例3: seeJsonContains

 /**
  * Assert that the response contains the given JSON.
  *
  * @param  array  $data
  * @param  bool  $negate
  * @return $this
  */
 protected function seeJsonContains(array $data, $negate = false)
 {
     $method = $negate ? 'assertFalse' : 'assertTrue';
     $actual = json_encode(Arr::sortRecursive((array) $this->decodeResponseJson()));
     foreach (Arr::sortRecursive($data) as $key => $value) {
         $expected = $this->formatToExpectedJson($key, $value);
         $this->{$method}(Str::contains($actual, $expected), ($negate ? 'Found unexpected' : 'Unable to find') . ' JSON fragment' . PHP_EOL . "[{$expected}]" . PHP_EOL . 'within' . PHP_EOL . "[{$actual}].");
     }
     return $this;
 }
開發者ID:scrubmx,項目名稱:framework,代碼行數:17,代碼來源:MakesHttpRequests.php

示例4: seeJsonContains

 /**
  * Assert that the response contains the given JSON.
  *
  * @param  array  $data
  * @param  bool  $negate
  * @return $this
  */
 protected function seeJsonContains(array $data, $negate = false)
 {
     $method = $negate ? 'assertFalse' : 'assertTrue';
     $actual = json_decode($this->response->getContent(), true);
     if (is_null($actual) || $actual === false) {
         return $this->fail('Invalid JSON was returned from the route. Perhaps an exception was thrown?');
     }
     $actual = json_encode(Arr::sortRecursive((array) $actual));
     foreach (Arr::sortRecursive($data) as $key => $value) {
         $expected = $this->formatToExpectedJson($key, $value);
         $this->{$method}(Str::contains($actual, $expected), ($negate ? 'Found unexpected' : 'Unable to find') . " JSON fragment [{$expected}] within [{$actual}].");
     }
     return $this;
 }
開發者ID:focuslife,項目名稱:v0.1,代碼行數:21,代碼來源:CrawlerTrait.php


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