Skip to content

Instantly share code, notes, and snippets.

View robdecker's full-sized avatar

Rob Decker robdecker

View GitHub Profile
@robdecker
robdecker / debug.twig
Last active January 19, 2021 18:50 — forked from zakiya/debug.twig
[Debugging Twig in Drupal] #d8 #twig
{# ~ Core ~ #}
{# {{ dump() }} #}
{# {{ dump(page) }} #}
{# ~ Devel~ #}
{# {{ kint()}} #}
{# {{ kint(page)}} #}
{# {{ devel_dump(page) }} #}
{# {{ devel_breakpoint() }} #}

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";

parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port;     // => "3000"
parser.pathname; // => "/pathname/"
parser.search;   // => "?search=test"
parser.hash; // => "#hash"