本文整理匯總了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;
}