-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
D002-testing: Add another page for demoing the DownloadController fun…
…ctionality.
- Loading branch information
1 parent
142e9b6
commit cea0292
Showing
2 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
lib/modules/responses/src/Controller/DownloadPageController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace Drupal\responses\Controller; | ||
|
||
use Drupal\Core\Controller\ControllerBase; | ||
|
||
/** | ||
* Returns responses for Responses routes. | ||
*/ | ||
final class DownloadPageController extends ControllerBase { | ||
|
||
/** | ||
* Builds the response. | ||
*/ | ||
public function __invoke(): array { | ||
|
||
$build['content'] = [ | ||
'#type' => 'item', | ||
'#markup' => '<p>' . $this->t('Click on button to download example pdf') . '</p></br>' | ||
. '<a class="button--primary button" href="pdf-download" target="_blank">' . $this->t('Download') . '</a>', | ||
]; | ||
|
||
return $build; | ||
} | ||
|
||
} |