initServices example

if ($hook instanceof StoppableHook && $hook->isPropagationStopped()) {
                break;
            }
        }
    }

    private function render(Hook $hook, Script $script): void
    {
        $twig = $this->initEnv($script);

        $services = $this->initServices($hook$script);

        $twig->addGlobal('services', $services);

        $this->traces->trace($hook$scriptfunction DDebug $debug) use ($twig$script$hook): void {
            $twig->addGlobal('debug', $debug);

            if ($hook instanceof DeprecatedHook) {
                ScriptTraces::addDeprecationNotice($hook->getDeprecationNotice());
            }

            $template = $twig->load($script->getName());

            
Home | Imprint | This part of the site doesn't use cookies.