當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DisplayPluginBase::validate方法代碼示例

本文整理匯總了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;
 }
開發者ID:HakS,項目名稱:drupal8_training,代碼行數:9,代碼來源:PathPluginBase.php

示例2: validate

 /**
  * {@inheritdoc}
  */
 public function validate()
 {
     $errors = parent::validate();
     foreach ($this->view->displayHandlers as $display_handler) {
         $errors[] = 'error';
     }
     return $errors;
 }
開發者ID:ddrozdik,項目名稱:dmaps,代碼行數:11,代碼來源:DisplayTest.php

示例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;
 }
開發者ID:nsp15,項目名稱:Drupal8,代碼行數:21,代碼來源:EntityReference.php


注:本文中的Drupal\views\Plugin\views\display\DisplayPluginBase::validate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。