本文整理汇总了PHP中Drupal\views\Plugin\views\PluginBase::init方法的典型用法代码示例。如果您正苦于以下问题:PHP PluginBase::init方法的具体用法?PHP PluginBase::init怎么用?PHP PluginBase::init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drupal\views\Plugin\views\PluginBase
的用法示例。
在下文中一共展示了PluginBase::init方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* Overrides \Drupal\views\Plugin\views\PluginBase::init().
*
* The style options might come externally as the style can be sourced from at
* least two locations. If it's not included, look on the display.
*/
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL)
{
parent::init($view, $display, $options);
if ($this->usesRowPlugin() && $display->getOption('row')) {
$this->view->rowPlugin = $display->getPlugin('row');
}
$this->options += array('grouping' => array());
}
示例2: init
/**
* {@inheritdoc}
*/
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL)
{
parent::init($view, $display, $options);
// Check to see if this handler type is defaulted. Note that
// we have to do a lookup because the type is singular but the
// option is stored as the plural.
$this->unpackOptions($this->options, $options);
// This exist on most handlers, but not all. So they are still optional.
if (isset($options['table'])) {
$this->table = $options['table'];
}
// Allow aliases on both fields and tables.
if (isset($this->definition['real table'])) {
$this->table = $this->definition['real table'];
}
if (isset($this->definition['real field'])) {
$this->realField = $this->definition['real field'];
}
if (isset($this->definition['field'])) {
$this->realField = $this->definition['field'];
}
if (isset($options['field'])) {
$this->field = $options['field'];
if (!isset($this->realField)) {
$this->realField = $options['field'];
}
}
$this->query =& $view->query;
}