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


PHP ViewExecutable::initDisplay方法代码示例

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


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

示例1: prepareView

 /**
  * Sets up the testing view with random field data.
  *
  * @param \Drupal\views\ViewExecutable $view
  *   The view to add field data to.
  */
 protected function prepareView(ViewExecutable $view)
 {
     $view->initDisplay();
     foreach ($this->fieldStorages as $field_storage) {
         $field_name = $field_storage->getName();
         $view->display_handler->options['fields'][$field_name]['id'] = $field_name;
         $view->display_handler->options['fields'][$field_name]['table'] = 'node__' . $field_name;
         $view->display_handler->options['fields'][$field_name]['field'] = $field_name;
     }
 }
开发者ID:davidsoloman,项目名称:drupalconsole.com,代码行数:16,代码来源:HandlerFieldFieldTest.php

示例2: assertTermWithDepthResult

 /**
  * Changes the tid filter to given term and depth.
  *
  * @param integer $tid
  *   The term ID to filter on.
  * @param integer $depth
  *   The depth to search.
  * @param array $expected
  *   The expected views result.
  */
 protected function assertTermWithDepthResult($tid, $depth, array $expected)
 {
     $this->view->destroy();
     $this->view->initDisplay();
     $filters = $this->view->displayHandlers->get('default')->getOption('filters');
     $filters['tid_depth']['depth'] = $depth;
     $filters['tid_depth']['value'] = [$tid];
     $this->view->displayHandlers->get('default')->setOption('filters', $filters);
     $this->executeView($this->view);
     $this->assertIdenticalResultsetHelper($this->view, $expected, ['nid' => 'nid'], 'assertIdentical');
 }
开发者ID:ddrozdik,项目名称:dmaps,代码行数:21,代码来源:TaxonomyTermFilterDepthTest.php

示例3: getMessages

 /**
  * Analyzes a review and return the results.
  *
  * @param \Drupal\views\ViewExecutable $view
  *   The view to analyze.
  *
  * @return array
  *   An array of analyze results organized into arrays keyed by 'ok',
  *   'warning' and 'error'.
  */
 public function getMessages(ViewExecutable $view)
 {
     $view->initDisplay();
     $messages = $this->moduleHandler->invokeAll('views_analyze', array($view));
     return $messages;
 }
开发者ID:ddrozdik,项目名称:dmaps,代码行数:16,代码来源:Analyzer.php


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