Skip to content

Instantly share code, notes, and snippets.

composer create-project drupal-composer/drupal-project:8.x-dev test1 --stability dev --no-interaction -vvv
cd test1
git init
git add .
git commit -m "init"
cd ..
git clone test1 test2
cd test2
composer install
{
"name": "drupal-composer/drupal-project",
"description": "Project template for Drupal 8 projects with composer",
"type": "project",
"license": "GPL-2.0+",
"authors": [
{
"name": "",
"role": ""
}
{
"type": "package",
"package": {
"name": "my-fork/dynamic_entity_reference",
"type": "drupal-module",
"version": "8.1.0-beta1",
"source": {
"url": "http://git.drupal.org/project/dynamic_entity_reference",
"type": "git",
"reference": "8.x-1.x"
<?php
<<<CONFIG
packages:
- "symfony/finder: ~2.5"
CONFIG;
$finder = Symfony\Component\Finder\Finder::create()
->in(__DIR__)
->files()
->name('*.php')
{
"name": "drupal-composer/drupal-project",
"description": "Composer template for Drupal projects",
"repositories": [
{
"type": "composer",
"url": "https://packagist.drupal-composer.org"
},
{
"type": "vcs",
@webflo
webflo / url.php
Created November 25, 2015 15:08 — forked from steffenr/url.php
Create link with attributes in Drupal 8
<?php
$url = Url::fromRoute('node.add', array('node_type' => $content_type));
$url->setOption('query', \Drupal::destination()->getAsArray(),);
$link = [
'#type' => 'link',
'#title' => t('Add !content_type content', array('!content_type' => $content_type)),
'#url' => $url,
'#attributes' => [
/**
* Implements hook_drush_command().
*
* @return array
*/
function [project]_drush_command() {
$items['custom-site-install'] = [
'description' => 'Install Drupal',
'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_ROOT,
];
/**
* Implements hook_entity_type_alter().
* @param \Drupal\Core\Entity\EntityTypeInterface[] $entity_types
*/
function example_contact_form_entity_type_alter(array &$entity_types) {
$entity_types['contact_message']->setViewBuilderClass('Drupal\example_contact_form\ContactMessageViewBuilder');
}
---
settings:
-
plugin: field_settings
source:
- '@type'
- global_settings
-
plugin: field_settings_content_taxonomy
source:
- '@value'