You are here

public function ContrivedController::displayAddedNumbers in Examples for Developers 8

Same name and namespace in other branches
  1. 3.x modules/testing_example/src/Controller/ContrivedController.php \Drupal\testing_example\Controller\ContrivedController::displayAddedNumbers()

A controller method which displays a sum in terms of hands.

Parameters

int $first: A parameter to the controller path.

int $second: A parameter to the controller path.

Return value

string[] A markup array.

1 string reference to 'ContrivedController::displayAddedNumbers'
testing_example.routing.yml in testing_example/testing_example.routing.yml
testing_example/testing_example.routing.yml

File

testing_example/src/Controller/ContrivedController.php, line 47

Class

ContrivedController
A highly-contrived controller class used to demonstrate unit testing.

Namespace

Drupal\testing_example\Controller

Code

public function displayAddedNumbers($first, $second) {
  return [
    '#markup' => '<p>' . $this
      ->handCount($first, $second) . '</p>',
  ];
}