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


PHP ViewExecutable::getShowAdminLinks方法代碼示例

本文整理匯總了PHP中Drupal\views\ViewExecutable::getShowAdminLinks方法的典型用法代碼示例。如果您正苦於以下問題:PHP ViewExecutable::getShowAdminLinks方法的具體用法?PHP ViewExecutable::getShowAdminLinks怎麽用?PHP ViewExecutable::getShowAdminLinks使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Drupal\views\ViewExecutable的用法示例。


在下文中一共展示了ViewExecutable::getShowAdminLinks方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: addContextualLinks

 /**
  * Converts Views block content to a renderable array with contextual links.
  *
  * @param string|array $output
  *   An string|array representing the block. This will be modified to be a
  *   renderable array, containing the optional '#contextual_links' property (if
  *   there are any contextual links associated with the block).
  * @param string $block_type
  *   The type of the block. If it's 'block' it's a regular views display,
  *   but 'exposed_filter' exist as well.
  */
 protected function addContextualLinks(&$output, $block_type = 'block')
 {
     // Do not add contextual links to an empty block.
     if (!empty($output)) {
         // Contextual links only work on blocks whose content is a renderable
         // array, so if the block contains a string of already-rendered markup,
         // convert it to an array.
         if (is_string($output)) {
             $output = array('#markup' => $output);
         }
         // views_add_contextual_links() needs the following information in
         // order to be attached to the view.
         $output['#view_id'] = $this->view->storage->id();
         $output['#view_display_show_admin_links'] = $this->view->getShowAdminLinks();
         $output['#view_display_plugin_id'] = $this->view->display_handler->getPluginId();
         views_add_contextual_links($output, $block_type, $this->displayID);
     }
 }
開發者ID:nsp15,項目名稱:Drupal8,代碼行數:29,代碼來源:ViewsBlockBase.php


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