本文整理汇总了PHP中Drupal\views\Plugin\views\display\DisplayPluginBase::validate方法的典型用法代码示例。如果您正苦于以下问题:PHP DisplayPluginBase::validate方法的具体用法?PHP DisplayPluginBase::validate怎么用?PHP DisplayPluginBase::validate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drupal\views\Plugin\views\display\DisplayPluginBase
的用法示例。
在下文中一共展示了DisplayPluginBase::validate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: validate
/**
* {@inheritdoc}
*/
public function validate()
{
$errors = parent::validate();
$errors += $this->validatePath($this->getOption('path'));
return $errors;
}
示例2: validate
/**
* {@inheritdoc}
*/
public function validate()
{
$errors = parent::validate();
foreach ($this->view->displayHandlers as $display_handler) {
$errors[] = 'error';
}
return $errors;
}
示例3: validate
/**
* Overrides \Drupal\views\Plugin\views\display\DisplayPluginBase::validate().
*/
public function validate()
{
$errors = parent::validate();
// Verify that search fields are set up.
$style = $this->getOption('style');
if (!isset($style['options']['search_fields'])) {
$errors[] = $this->t('Display "@display" needs a selected search fields to work properly. See the settings for the Entity Reference list format.', array('@display' => $this->display['display_title']));
} else {
// Verify that the search fields used actually exist.
$fields = array_keys($this->handlers['field']);
foreach ($style['options']['search_fields'] as $field_alias => $enabled) {
if ($enabled && !in_array($field_alias, $fields)) {
$errors[] = $this->t('Display "@display" uses field %field as search field, but the field is no longer present. See the settings for the Entity Reference list format.', array('@display' => $this->display['display_title'], '%field' => $field_alias));
}
}
}
return $errors;
}