當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。