当前位置: 首页>>代码示例>>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;未经允许,请勿转载。