public function UserRegisterBlock::build in Form Block 8
Same name and namespace in other branches
- 2.0.x src/Plugin/Block/UserRegisterBlock.php \Drupal\formblock\Plugin\Block\UserRegisterBlock::build()
Implements \Drupal\block\BlockBase::build().
Overrides BlockPluginInterface::build
File
- src/
Plugin/ Block/ UserRegisterBlock.php, line 77
Class
- UserRegisterBlock
- Provides a block for the user registration form.
Namespace
Drupal\formblock\Plugin\BlockCode
public function build() {
$build = [];
$account = $this->entityTypeManager
->getStorage('user')
->create([]);
$build['form'] = $this->entityFormBuilder
->getForm($account, 'register');
return $build;
}