class JqueryUiTestAssetsController
Same name and namespace in other branches
- 11.x core/modules/system/tests/modules/jqueryui_library_assets_test/src/Controller/JqueryUiTestAssetsController.php \Drupal\jqueryui_library_assets_test\Controller\JqueryUiTestAssetsController
Controller for testing jQuery UI asset loading order.
Hierarchy
- class \Drupal\Core\Controller\ControllerBase extends \Drupal\Core\DependencyInjection\ContainerInjectionInterface uses \Drupal\Core\Logger\LoggerChannelTrait, \Drupal\Core\Messenger\MessengerTrait, \Drupal\Core\Routing\RedirectDestinationTrait, \Drupal\Core\StringTranslation\StringTranslationTrait
- class \Drupal\jqueryui_library_assets_test\Controller\JqueryUiTestAssetsController implements \Drupal\Core\Controller\ControllerBase
Expanded class hierarchy of JqueryUiTestAssetsController
File
-
core/
modules/ system/ tests/ modules/ jqueryui_library_assets_test/ src/ Controller/ JqueryUiTestAssetsController.php, line 10
Namespace
Drupal\jqueryui_library_assets_test\ControllerView source
class JqueryUiTestAssetsController extends ControllerBase {
/**
* Provides a page that loads a library.
*
* @param string $library
* A pipe delimited list of library names.
*
* @return array
* The render array.
*/
public function build($library) {
// If there are pipes in $library, they are separating multiple library
// names.
if (strpos($library, '|') !== FALSE) {
$library = explode('|', $library);
$library = array_map(function ($item) {
return "core/{$item}";
}, $library);
}
else {
$library = "core/{$library}";
}
return [
'#markup' => 'I am a page for testing jQuery UI asset loading order.',
'#attached' => [
'library' => $library,
],
];
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.