Commit post / notes / David's module as it was day of presentation

This commit is contained in:
benjamin melançon 2020-03-19 14:19:39 -04:00
parent 4f8eb192d3
commit dadc20295d
3 changed files with 45 additions and 0 deletions

View file

@ -0,0 +1,4 @@
name: "Project Copyright"
type: module
description: "Generate a block with the copyright leyend."
core: "8.x"

View 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')]),
];
}
}