Skip to content

Instantly share code, notes, and snippets.

View MahmoudSayed96's full-sized avatar
🏠
Working from home

Mahmoud Sayed Hassan MahmoudSayed96

🏠
Working from home
View GitHub Profile
@MahmoudSayed96
MahmoudSayed96 / mymodule.install
Created December 22, 2021 12:24 — forked from marcvangend/mymodule.install
Drupal 8: Custom path aliases exported to code.
<?php
/**
* @file
* Install, update and uninstall functions for my module.
*/
use Drupal\Core\Database\Database;
use Drupal\Core\Language\LanguageInterface;
/**
@MahmoudSayed96
MahmoudSayed96 / Blocks.md
Created November 14, 2022 09:05 — forked from davidjguru/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');

Need to do this in both php.ini files !!!

Attention Wamp/Wordpress/windows users. I had this issue for hours and not even the correct answer was doing it for me, because i was editing the wrong php.ini file because the question was answered to XAMPP and not for WAMP users, even though the question was for WAMP.

here's what i did

Download the certificate bundle.

Put it inside of C:\wamp64\bin\php\your php version\extras\ssl