Commit post / notes / David's module as it was day of presentation
This commit is contained in:
parent
4f8eb192d3
commit
dadc20295d
3 changed files with 45 additions and 0 deletions
4
when-not-module-for-that/copyright/copyright.info.yml
Executable file
4
when-not-module-for-that/copyright/copyright.info.yml
Executable file
|
@ -0,0 +1,4 @@
|
|||
name: "Project Copyright"
|
||||
type: module
|
||||
description: "Generate a block with the copyright leyend."
|
||||
core: "8.x"
|
27
when-not-module-for-that/copyright/src/Plugin/Block/Copyright.php
Executable file
27
when-not-module-for-that/copyright/src/Plugin/Block/Copyright.php
Executable file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\copyright\Plugin\Block;
|
||||
|
||||
use Drupal\Core\Block\BlockBase;
|
||||
|
||||
/**
|
||||
* Provides a block with the copyright legend.
|
||||
*
|
||||
* @Block(
|
||||
* id = "copyright_block",
|
||||
* admin_label = @Translation("Copyright"),
|
||||
* )
|
||||
*/
|
||||
class Copyright extends BlockBase {
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function build() {
|
||||
return [
|
||||
'#markup' => $this->t('Copyright © @year All rights reserved', ['@year' => date('Y')]),
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue