Template library for skeleton
General templating for Skeleton. This library supports multiple templating libraries as back-end. Currently only the Twig back-end is supported via skeleton-template-twig, (*1)
Installation via composer:, (*2)
composer require tigron/skeleton-template
// Initialize a template object $template = new \Skeleton\Template\Template(); // Add a template path $template->add_template_path($my_very_cool_path); // Set a translation object (optional); $template->set_translation(\Skeleton\I18n\Translation $translation); // Assign variables $template->assign('my_variable_name', 'content1'); $template->assign('my_variable_name2', 'content2'); // return the rendered template $html = $template->render('test.twig'); // $html contains the rendered template