当前位置: 首页>>代码示例>>PHP>>正文


PHP ViewExecutable::initHandlers方法代码示例

本文整理汇总了PHP中Drupal\views\ViewExecutable::initHandlers方法的典型用法代码示例。如果您正苦于以下问题:PHP ViewExecutable::initHandlers方法的具体用法?PHP ViewExecutable::initHandlers怎么用?PHP ViewExecutable::initHandlers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Drupal\views\ViewExecutable的用法示例。


在下文中一共展示了ViewExecutable::initHandlers方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: viewExposedFormBlocks

 /**
  * {@inheritdoc}
  */
 public function viewExposedFormBlocks()
 {
     // Avoid interfering with the admin forms.
     $route_name = \Drupal::routeMatch()->getRouteName();
     if (strpos($route_name, 'views_ui.') === 0) {
         return;
     }
     $this->view->initHandlers();
     if ($this->usesExposed() && $this->getOption('exposed_block')) {
         $exposed_form = $this->getPlugin('exposed_form');
         return $exposed_form->renderExposedForm(TRUE);
     }
 }
开发者ID:318io,项目名称:318-io,代码行数:16,代码来源:DisplayPluginBase.php

示例2: viewExposedFormBlocks

 /**
  * Render the exposed form as block.
  *
  * @return string|null
  *  The rendered exposed form as string or NULL otherwise.
  */
 public function viewExposedFormBlocks()
 {
     // Avoid interfering with the admin forms.
     $route_name = \Drupal::request()->attributes->get(RouteObjectInterface::ROUTE_NAME);
     if (strpos($route_name, 'views_ui.') === 0) {
         return;
     }
     $this->view->initHandlers();
     if ($this->usesExposed() && $this->getOption('exposed_block')) {
         $exposed_form = $this->getPlugin('exposed_form');
         return $exposed_form->renderExposedForm(TRUE);
     }
 }
开发者ID:shumer,项目名称:blog,代码行数:19,代码来源:DisplayPluginBase.php

示例3: assertGrid

 /**
  * Generates a grid and asserts that it is displaying correctly.
  *
  * @param \Drupal\views\ViewExecutable $view
  *   The executable to prepare.
  * @param string $alignment
  *   The alignment of the grid to test.
  * @param int $columns
  *   The number of columns in the grid to test.
  */
 protected function assertGrid(ViewExecutable $view, $alignment, $columns)
 {
     $view->setDisplay('default');
     $view->initStyle();
     $view->initHandlers();
     $view->initQuery();
     $view->style_plugin->options['alignment'] = $alignment;
     $view->style_plugin->options['columns'] = $columns;
     $this->executeView($view);
     $output = $view->preview();
     $output = drupal_render($output);
     $this->setRawContent($output);
     if (!in_array($alignment, $this->alignmentsTested)) {
         $result = $this->xpath('//div[contains(@class, "views-view-grid") and contains(@class, :alignment) and contains(@class, :columns)]', array(':alignment' => $alignment, ':columns' => 'cols-' . $columns));
         $this->assertTrue(count($result), ucfirst($alignment) . " grid markup detected.");
         $this->alignmentsTested[] = $alignment;
     }
     $width = '0';
     switch ($columns) {
         case 5:
             $width = '20';
             break;
         case 4:
             $width = '25';
             break;
         case 3:
             $width = '33.3333';
             break;
         case 2:
             $width = '50';
             break;
         case 1:
             $width = '100';
             break;
     }
     // Ensure last column exists.
     $result = $this->xpath('//div[contains(@class, "views-col") and contains(@class, :columns) and starts-with(@style, :width)]', array(':columns' => 'col-' . $columns, ':width' => 'width: ' . $width));
     $this->assertTrue(count($result), ucfirst($alignment) . " {$columns} column grid: last column exists and automatic width calculated correctly.");
     // Ensure no extra columns were generated.
     $result = $this->xpath('//div[contains(@class, "views-col") and contains(@class, :columns)]', array(':columns' => 'col-' . ($columns + 1)));
     $this->assertFalse(count($result), ucfirst($alignment) . " {$columns} column grid: no extraneous columns exist.");
     // Ensure tokens are being replaced in custom row/column classes.
     $result = $this->xpath('//div[contains(@class, "views-col") and contains(@class, "name-John")]');
     $this->assertTrue(count($result), ucfirst($alignment) . " {$columns} column grid: Token replacement verified in custom column classes.");
     $result = $this->xpath('//div[contains(@class, "views-row") and contains(@class, "age-25")]');
     $this->assertTrue(count($result), ucfirst($alignment) . " {$columns} column grid: Token replacement verified in custom row classes.");
 }
开发者ID:nstielau,项目名称:drops-8,代码行数:57,代码来源:StyleGridTest.php

示例4: prepareView

 /**
  * Prepares a view executable by initializing everything which is needed.
  *
  * @param \Drupal\views\ViewExecutable $view
  *   The executable to prepare.
  */
 protected function prepareView(ViewExecutable $view)
 {
     $view->setDisplay();
     $view->initStyle();
     $view->initHandlers();
     $view->initQuery();
 }
开发者ID:aWEBoLabs,项目名称:taxi,代码行数:13,代码来源:StyleTableUnitTest.php


注:本文中的Drupal\views\ViewExecutable::initHandlers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。