PHP code example of arveres / arveres-template

1. Go to this page and download the library: Download arveres/arveres-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/ */

    

arveres / arveres-template example snippets




use ArveresTemplate\Engine;
use ArveresTemplate\Macros;

//Cria a instância e define o diretório das views
$engine = new Engine('/path/to/template');

//Adiciona classe com funções para o templete engine
$engine->dependencies([new Macros()]);

//Renderiza o template
echo $engine->render('home', ['foo' => 'bar']);

 $this->extends('main', ['title' => 'home page']) 

<html>
    <head>
       <title> echo $this->title 

<body>
    <ul>
        
             foreach ($this->users as $user) {
                echo '<li>' . $this->lower($user->name) . '</li>';
             }