Skip to content

Instantly share code, notes, and snippets.

@chandantbs
chandantbs / ChandanUserController.php
Created March 10, 2022 06:12
Drupal 9 - Load entity form in modal popup
class ChandanUserController extends ControllerBase {
/// class properties etc.
/// construction
public function editProfile() {
// Entity you want to edit.
$entity = User::load(1);
// Form builder service
$builder = \Drupal::service('entity.form_builder');
// get the form: form mode = 'profile', it is not default form mode.
// new form can be created on the "Form Display Setting"
@chandantbs
chandantbs / 2019-https-localhost.md
Created October 21, 2020 16:16 — forked from cecilemuller/2019-https-localhost.md
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

#!/bin/sh
sed -i.default "s/^zend_extension=/;zend_extension=/" /usr/local/etc/php/7.1/conf.d/ext-xdebug.ini
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.php71.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php71.plist
sudo brew services restart php71
echo "xdebug disabled"