// Require Composer autoload file require_once 'vendor/autoload.php'; // Initialize Twig $loader = new \Twig\Loader\FilesystemLoader('views'); $twig = new \Twig\Environment($loader, [ 'cache' => 'cache', ]);
// Require Smarty autoload file require_once 'vendor/smarty/smarty/libs/Smarty.class.php'; // Initialize Smarty $smarty = new Smarty(); $smarty->setTemplateDir('views'); $smarty->setCompileDir('cache/smarty');In both of these examples, the package library used is the template engine library specific to setting up the view in PHP. In the first example, the specific package library is Twig, while in the second example, the package library is Smarty.