本文整理汇总了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;
}
}
示例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');
}
示例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;
}