jdoc

This variable is a proxy of Factory::getDocument(). It allows to access the active document inside twig layouts.

  1. Returns
  2. Examples

Returns

\Joomla\CMS\Document\Document The active document.

Examples


{# Load a script in this page from a twig layout #}
{% do jdoc.addScriptDeclaration('alert("Hello world!")') %}