Created
March 7, 2017 14:22
-
-
Save prasadshir/0bbba050e9f5cd16591822f9d143702c to your computer and use it in GitHub Desktop.
D728:Task-03: Create a custom block
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
<?php | |
/** | |
* Controller for the Block in the lotus module for D8. | |
* Add this file to src/Plugin/Block/ folder of the module | |
**/ | |
namespace Drupal\lotus\Plugin\Block; | |
use Drupal\Core\Block\BlockBase; | |
/** | |
* Provides a 'Hello' Block | |
* | |
* @Block( | |
* id = "hello_block", | |
* admin_label = @Translation("Hello block"), | |
* ) | |
*/ | |
class HelloBlock extends BlockBase { | |
/** | |
* {@inheritdoc} | |
*/ | |
public function build() { | |
return array( | |
'#markup' => $this->t('Welcome to Lotus website!'), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment