Skip to content

Instantly share code, notes, and snippets.

@davebeach
davebeach / NewUserRegisterForm.php
Created June 1, 2017 07:52 — forked from davidDuymelinck/NewUserRegisterForm.php
Extend drupal 8 user register form
<?php
namespace Drupal\my_module\Form;
use Drupal\Component\Datetime\TimeInterface;
use Drupal\Core\Entity\EntityFormBuilderInterface;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Entity\EntityTypeBundleInfoInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
@annikaC
annikaC / AccountEditRedirectController.php
Created September 29, 2016 14:03
Drupal 8 redirect user to own user edit page (for use in menu links)
<?php
namespace Drupal\yourmodule\Controller;
use Drupal\Core\Controller\ControllerBase;
use Symfony\Component\HttpFoundation\RedirectResponse;
/**
* A controller that redirects to the current user's edit account page.
@jmolivas
jmolivas / DefaultController.php
Last active August 20, 2022 18:57
Drupal 8 example: How to render a Twig template and load a CSS file from a Controller
<?php
namespace Drupal\acme\Controller;
use Drupal\Core\Controller\ControllerBase;
class DefaultController extends ControllerBase
{
/**