当前位置: 首页>>代码示例>>PHP>>正文


PHP ArrayHelper::getvalue方法代码示例

本文整理汇总了PHP中yii\helpers\ArrayHelper::getvalue方法的典型用法代码示例。如果您正苦于以下问题:PHP ArrayHelper::getvalue方法的具体用法?PHP ArrayHelper::getvalue怎么用?PHP ArrayHelper::getvalue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在yii\helpers\ArrayHelper的用法示例。


在下文中一共展示了ArrayHelper::getvalue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: beginPjax

 /**
  * Begins the PJAX container
  */
 protected function beginPjax()
 {
     if (!$this->pjax) {
         return;
     }
     $view = $this->getView();
     if (empty($this->pjaxSettings['options']['id'])) {
         $this->pjaxSettings['options']['id'] = $this->options['id'] . '-pjax';
     }
     $container = 'jQuery("#' . $this->pjaxSettings['options']['id'] . '")';
     $js = $container;
     if (ArrayHelper::getvalue($this->pjaxSettings, 'neverTimeout', true)) {
         $js .= ".on('pjax:timeout', function(e){e.preventDefault()})";
     }
     $loadingCss = ArrayHelper::getvalue($this->pjaxSettings, 'loadingCssClass', 'kv-grid-loading');
     $postPjaxJs = "setTimeout({$this->_gridClientFunc}, 2500);";
     if ($loadingCss !== false) {
         $grid = 'jQuery("#' . $this->containerOptions['id'] . '")';
         if ($loadingCss === true) {
             $loadingCss = 'kv-grid-loading';
         }
         $js .= ".on('pjax:send', function(){{$grid}.addClass('{$loadingCss}')})";
         $postPjaxJs .= "{$grid}.removeClass('{$loadingCss}');";
     }
     if (!empty($postPjaxJs)) {
         $event = 'pjax:complete.' . hash('crc32', $postPjaxJs);
         $js .= ".off('{$event}').on('{$event}', function(){{$postPjaxJs}})";
     }
     if ($js != $container) {
         $view->registerJs("{$js};");
     }
     Pjax::begin($this->pjaxSettings['options']);
     echo ArrayHelper::getValue($this->pjaxSettings, 'beforeGrid', '');
 }
开发者ID:hscstudio,项目名称:psiaga,代码行数:37,代码来源:GridView.php

示例2: renderPjax

 protected function renderPjax()
 {
     if (!$this->pjax) {
         return;
     }
     $view = $this->getView();
     if (empty($this->pjaxSettings['options']['id'])) {
         $this->pjaxSettings['options']['id'] = $this->options['id'] . '-pjax';
     }
     $container = 'jQuery("#' . $this->pjaxSettings['options']['id'] . '")';
     if (ArrayHelper::getvalue($this->pjaxSettings, 'neverTimeout', true)) {
         $view->registerJs("{$container}.on('pjax:timeout', function(e){e.preventDefault()});");
     }
     $loadingCss = ArrayHelper::getvalue($this->pjaxSettings, 'loadingCssClass', 'kv-grid-loading');
     $postPjaxJs = '';
     if ($loadingCss !== false) {
         $grid = 'jQuery("#' . $this->containerOptions['id'] . '")';
         if ($loadingCss === true) {
             $loadingCss = 'kv-grid-loading';
         }
         $view->registerJs("{$container}.on('pjax:send', function(){{$grid}.addClass('{$loadingCss}')});");
         $postPjaxJs = "{$grid}.removeClass('{$loadingCss}');";
     }
     if (!empty($this->_jsExportScript)) {
         $id = 'jQuery("#' . $this->id . ' .export-csv")';
         $postPjaxJs .= "\n{$this->_jsExportScript}";
     }
     if (!empty($this->_jsFloatTheadScript)) {
         $postPjaxJs .= "\n{$this->_jsFloatTheadScript}";
     }
     if (!empty($postPjaxJs)) {
         $view->registerJs("{$container}.on('pjax:complete', function(){{$postPjaxJs}});");
     }
     Pjax::begin($this->pjaxSettings['options']);
     echo ArrayHelper::getValue($this->pjaxSettings, 'beforeGrid', '');
 }
开发者ID:t-tomek,项目名称:yii2-grid,代码行数:36,代码来源:GridView.php


注:本文中的yii\helpers\ArrayHelper::getvalue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。