3 namespace Drupal\paramconverter_test;
5 use Drupal\Core\Entity\EntityInterface;
6 use Drupal\node\NodeInterface;
9 * Controller routine for testing the paramconverter.
11 class TestControllers {
13 public function testUserNodeFoo(EntityInterface $user, NodeInterface $node, $foo) {
14 $foo = is_object($foo) ? $foo->label() : $foo;
15 return ['#markup' => "user: {$user->label()}, node: {$node->label()}, foo: $foo"];
18 public function testNodeSetParent(NodeInterface $node, NodeInterface $parent) {
19 return ['#markup' => "Setting '{$parent->label()}' as parent of '{$node->label()}'."];
22 public function testEntityLanguage(NodeInterface $node) {
23 $build = ['#markup' => $node->label()];
24 \Drupal::service('renderer')->addCacheableDependency($build, $node);