$view = new View('template.php', ['name' => 'John']); echo $view->render();
$view = new View('products.php', ['products' => $products]); echo $view->render();This example creates a new View instance with the template file `products.php` and data array `['products' => $products]`. The data array contains an array of product objects, which is then used to generate the product listing on the page. This code examples use Laravel package library.