Skip to content

Instantly share code, notes, and snippets.

View mitchellshelton's full-sized avatar

Mitchell Shelton mitchellshelton

View GitHub Profile
@mitchellshelton
mitchellshelton / FormTest.php
Last active October 21, 2018 15:52 — forked from AlexSkrypnyk/mymodule.css
Drupal 'add more' and 'remove single' AJAX buttons on multi value custom field using FormAPI. Converted to a D8 version, forked from https://github.com/alexdesignworks
<?php
/**
* @file
* Contains \Drupal\mymodule\Form\FormTest.
*/
namespace Drupal\mymodule\Form;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
<snippet>
<content><![CDATA[
print '<pre>';
var_dump($1);
print '</pre>';$0
]]></content>
<!-- Optional: Tab trigger to activate the snippet -->
<tabTrigger>var_dump(</tabTrigger>
<!-- Optional: Description to show in the menu -->
<description>Wrap a var_dump function in preformat html tags.</description>
<snippet>
<content><![CDATA[
print '<pre>';
print_r($1);
print '</pre>';$0
]]></content>
<!-- Optional: Tab trigger to activate the snippet -->
<tabTrigger>print_r(</tabTrigger>
<!-- Optional: Description to show in the menu -->
<description>Wrap a print_r function in preformat html tags.</description>