PHP code example of albertoadolfo27 / friendly_template

1. Go to this page and download the library: Download albertoadolfo27/friendly_template library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

albertoadolfo27 / friendly_template example snippets



// Require the Composer autoloader.
ntiate a Template, passing the base directory of the template files.
$template = new Template("views/");

// Draw the Header
$template->draw("header", array("title" => "Hello World!"));

// Draw the Main Content
$template->draw("content", array("user" => "John Doe"));

// Draw the Footer
$template->draw("footer.php");

<!DOCTYPE html>
<html lang="en">

<head>
    <title> echo $title; 

<div class="content">
    <h2>Content Template</h2>
    <p>Welcome <b> echo $user; 

<div class="footer">
    <p>Footer</p>
</div>

</body>

</html>