Skip to content

Instantly share code, notes, and snippets.

View lcube45's full-sized avatar
🏌️‍♂️
Focusing

lcube lcube45

🏌️‍♂️
Focusing
View GitHub Profile
@lcube45
lcube45 / ContactForm-basic.php
Created May 11, 2022 16:03 — forked from WengerK/ContactForm-basic.php
Drupal 8 — Inline validation in forms
<?php
/**
* @file
* Contains \Drupal\my_contact\Form\ContactForm.
*/
namespace Drupal\my_contact\Form;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
@lcube45
lcube45 / php-docker-ext
Created May 11, 2022 12:03 — forked from hoandang/php-docker-ext
Complete list of php docker ext
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN docker-php-ext-install mcrypt
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
@lcube45
lcube45 / Blocks.md
Created January 13, 2020 15:36 — forked from bdlangton/Blocks.md
Drupal 8 programmatic solutions

Render custom blocks

$bid = 'myblock';
$block = \Drupal\block_content\Entity\BlockContent::load($bid);
$render = \Drupal::entityTypeManager()->getViewBuilder('block_content')->view($block);

Render plugin blocks

$block_manager = \Drupal::service('plugin.manager.block');