Skip to content

Instantly share code, notes, and snippets.

View rakeshjames's full-sized avatar
💤

Rakesh James rakeshjames

💤
View GitHub Profile
ID name email firstname lastname Status roles Password
1 rakesh rakesh.james@gmail.com Rakesh James 1 administrator,migrationuser rakesh@123
2 james james.rakesh@gmail.com James Rakesh 1 authenticated james@123
3 dummy dummy@gmail.com Dummy User 1 migrationuser,administrator dummy@123
id: demo_user_migration
migration_tags: null
migration_group: null
label: 'User migration from CSV'
source:
plugin: csv
path: /Library/WebServer/Documents/d8/sites/default/files/demousers_migrate.csv
header_row_count: 1
keys:
- ID
ID name email firstname lastname Status roles
1 rakesh rakesh.james@gmail.com Rakesh James 1 administrator
2 james james.rakesh@gmail.com James Rakesh 1 authenticated
3 dummy dummy@gmail.com Dummy User 1 testuser
services:
example_events.event_subscriber_example:
class: Drupal\example_events\EventSubscriber\ExampleEventSubScriber
tags:
- { name: 'event_subscriber' }
<?php
/**
* @file
* Contains \Drupal\example_events\ExampleEventSubScriber.
*/
namespace Drupal\example_events\EventSubscriber;
use Drupal\Core\Config\ConfigCrudEvent;
<?php
/**
* @file
* Contains \Drupal\example_events\Form\DemoEventDispatchForm.
*/
namespace Drupal\example_events\Form;
use Drupal\Core\Form\FormBase;
@rakeshjames
rakeshjames / example_dispatching_an_example_event.php
Created July 14, 2016 20:50
Example for how to dispatch an example event in Drupal 8?
<?php
// Following is the example for How to dispatch an event in Drupal 8?
// Use the namespace of the ExampleEvent class
use Drupal\example_events\ExampleEvent;
// load the Symfony event dispatcher object through services
$dispatcher = \Drupal::service('event_dispatcher');
// creating our event class object.
<?php
namespace Drupal\example_events;
use Symfony\Component\EventDispatcher\Event;
class ExampleEvent extends Event {
const SUBMIT = 'event.submit';
protected $referenceID;