use AppRender\HtmlRenderer; $view = new HtmlRenderer('path/to/view.php'); $data = array('name' => 'John Doe', 'age' => 30); $html = $view->render($data); echo $html;
use AppRender\PdfRenderer; $view = new PdfRenderer('path/to/view.php'); $data = array('name' => 'John Doe', 'age' => 30); $pdf = $view->render($data); $pdf->Output('example.pdf', 'D');In this example, we use the `PdfRenderer` class to create a PDF file from our view. We pass in the path to the view file and the data that we want to use in the render method. We then call the `Output` method to generate the PDF file and force the browser to download it. Overall, the PHP app render library is a simple but powerful tool for rendering different types of views in PHP applications. This library can be used as a standalone package or as part of a larger application framework.