class CallsDestructableServiceController
Same name and namespace in other branches
- 11.x core/modules/system/tests/modules/destructable_test/src/Controller/CallsDestructableServiceController.php \Drupal\destructable_test\Controller\CallsDestructableServiceController
- 10 core/modules/system/tests/modules/destructable_test/src/Controller/CallsDestructableServiceController.php \Drupal\destructable_test\Controller\CallsDestructableServiceController
Controller to instantiate the destructable service.
Hierarchy
- class \Drupal\Core\Controller\ControllerBase implements \Drupal\Core\DependencyInjection\ContainerInjectionInterface uses \Drupal\Core\DependencyInjection\AutowireTrait, \Drupal\Core\Logger\LoggerChannelTrait, \Drupal\Core\Messenger\MessengerTrait, \Drupal\Core\Routing\RedirectDestinationTrait, \Drupal\Core\StringTranslation\StringTranslationTrait
- class \Drupal\destructable_test\Controller\CallsDestructableServiceController extends \Drupal\Core\Controller\ControllerBase
Expanded class hierarchy of CallsDestructableServiceController
File
-
core/
modules/ system/ tests/ modules/ destructable_test/ src/ Controller/ CallsDestructableServiceController.php, line 15
Namespace
Drupal\destructable_test\ControllerView source
final class CallsDestructableServiceController extends ControllerBase {
/**
* Destructable service.
*
* @var \Drupal\destructable_test\Destructable
*/
protected $destructable;
public function __construct(Destructable $destructable) {
$this->destructable = $destructable;
}
/**
* Render callback.
*
* @return \Symfony\Component\HttpFoundation\Response
* Response.
*/
public function render(Request $request) : Response {
$this->destructable
->setSemaphore($request->query
->get('semaphore'));
return new Response('This is a longer-ish string of content to send to the client, to invoke any trivial transfer buffers both on the server and client side.');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.