Skip to content

Instantly share code, notes, and snippets.

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

Marvin J. Cortés mcortes19

🏠
Working from home
View GitHub Profile
@mcortes19
mcortes19 / custom_pane_panelizer.php
Created January 24, 2020 17:40 — forked from pcambra/custom_pane_panelizer.php
How to add a pane to a node with panelizer programmatically
<?php
// This code can be used in a hook_update_n to add a custom pane to an existing display in panelizer.
// Example variables used in the code below.
$nid = 1;
$pane_machine_name = 'my_example_custom_pane';
$region = 'content';
$position = 0;
@mcortes19
mcortes19 / dependency_injection.md
Created August 6, 2020 04:02 — forked from ozin7/Controller.php
Drupal 8: Dependency injection in Service, Controller, Plugin.

Service

gurei.services.yml

services:
  gurei.company_manager:
    class: Drupal\gurei\Service\CompanyService
    arguments:
      - '@entity_type.manager'

CompanyService.php