drupal 8

Get the UID of the currently logged in user

\Drupal::currentUser() leverages the AccountProxy class, which is "a proxied implementation of AccountInterface". This means..

Making content themeable in Drupal 8

hook_theme() is still there and its implementation hasn't really changed since Drupal 7.

Loading entities

// Use the static method $node = Node::load(1); // Dynamic entity type, entity_load() now loads

drupal_goto() replacements in Drupal 8

drupal_goto() has been removed in Drupal 8. To apply a internal or external redirect there are several options.

Creating a node programmatically

There are 3 methods of creating a node (or with some slight adjustments any content entity) in Drupal 8:

Menu items toevoegen in een Drupal 8 module

Om een route, door je module gedefinieerd in het .routing.yml-bestand, in één van de bestaande menu's te laten verschijnen, voegen we een .links.menu.yml configuratiebestand aan de module toe. De inhoud ziet er ongeveer als volgt uit en moet tenminste de volgende regels bevatten (voorbeeld uit dblog.links.menu.yml)

Video: Wim Leers - Building really fast websites with drupal 8

Drupal 8 is going to have better front-end performance for anonymous users out of the box: it is now smart enough to no longer load unnecessary JavaScript. It's also (finally!) going to cache all entities efficiently, so that it doesn't waste time rerendering the same content over and over again.


Subscribe to RSS - drupal 8