getSnippetsFromDir example

'rendered' => $this->twig->render('@Framework/snippets/render.html.twig', $parameters),
        ]);
    }

    /** * @return array<int, string> */
    private function getCoreSnippets(): array
    {
        $directory = __DIR__ . '/../../Resources/views/snippets/';

        return $this->getSnippetsFromDir($directory);
    }

    /** * @return array<int, string> */
    private function getPluginSnippets(): array
    {
        $snippets = [];

        foreach ($this->plugins->getActives() as $plugin) {
            $snippetDir = $plugin->getPath() . '/Resources/views/snippets/';

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