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


PHP ModuleHandlerInterface::resetImplementations方法代碼示例

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


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

示例1: testHooks

 /**
  * Tests the hooks.
  */
 public function testHooks()
 {
     $view = Views::getView('test_view');
     $view->setDisplay();
     // Test each hook is found in the implementations array and is invoked.
     foreach (static::$hooks as $hook => $type) {
         $this->assertTrue($this->moduleHandler->implementsHook('views_test_data', $hook), format_string('The hook @hook was registered.', array('@hook' => $hook)));
         if ($hook == 'views_post_render') {
             $this->moduleHandler->invoke('views_test_data', $hook, array($view, &$view->display_handler->output, $view->display_handler->getPlugin('cache')));
             continue;
         }
         switch ($type) {
             case 'view':
                 $this->moduleHandler->invoke('views_test_data', $hook, array($view));
                 break;
             case 'alter':
                 $data = array();
                 $this->moduleHandler->invoke('views_test_data', $hook, array($data));
                 break;
             default:
                 $this->moduleHandler->invoke('views_test_data', $hook);
         }
         $this->assertTrue($this->container->get('state')->get('views_hook_test_' . $hook), format_string('The %hook hook was invoked.', array('%hook' => $hook)));
         // Reset the module implementations cache, so we ensure that the
         // .views.inc file is loaded actively.
         $this->moduleHandler->resetImplementations();
     }
 }
開發者ID:neetumorwani,項目名稱:blogging,代碼行數:31,代碼來源:ViewsHooksTest.php

示例2: submitForm

 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     parent::submitForm($form, $form_state);
     $values = $form_state->getValues();
     $this->config('ds.settings')->set('field_template', $values['fs1']['field_template'])->set('ft-default', $values['fs1']['ft-default'])->set('ft-show-colon', $values['fs1']['ft-show-colon'])->save();
     $this->entityFieldManager->clearCachedFieldDefinitions();
     $this->moduleHandler->resetImplementations();
     $this->themeRegistry->reset();
     $this->routeBuilder->setRebuildNeeded();
     \Drupal::cache('render')->deleteAll();
 }
開發者ID:neeravbm,項目名稱:unify-d8,代碼行數:14,代碼來源:SettingsForm.php


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