ViewsTestDataController.php in Drupal 8
File
core/modules/views/tests/modules/views_test_data/src/Controller/ViewsTestDataController.php
View source
<?php
namespace Drupal\views_test_data\Controller;
use Drupal\Core\Security\TrustedCallbackInterface;
class ViewsTestDataController implements TrustedCallbackInterface {
public function errorFormPage() {
$build = [];
$build['view'] = [
'#type' => 'view',
'#name' => 'test_exposed_form_buttons',
];
$build['error_form'] = \Drupal::formBuilder()
->getForm('Drupal\\views_test_data\\Form\\ViewsTestDataErrorForm');
return $build;
}
public static function placeholderLazyBuilder() {
return [];
}
public static function preRender($element) {
$element['#markup'] = '\\Drupal\\views_test_data\\Controller\\ViewsTestDataController::preRender executed';
return $element;
}
public static function trustedCallbacks() {
return [
'placeholderLazyBuilder',
'preRender',
];
}
}