PHP code example of sopheos / pebble_template

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

    

sopheos / pebble_template example snippets


use Pebble\Template\View;

echo View::create(__DIR__ . '/views/page.phtml', ['title' => 'Accueil', 'items' => $items]);

<!-- views/page.phtml -->
<h1><?= self::xss($title) 

echo View::tag('a', 'Accueil', ['href' => '/', 'class' => 'nav', 'data-active' => true]);
// <a href="/" class="nav" data-active>Accueil</a>

echo View::meta([
    ['charset' => 'utf-8'],
    ['name' => 'description', 'content' => $description],
    ['rel' => 'canonical', 'href' => $url],
]);

PlainText::add('Bonjour %s,', $name)->eol(2)->add('Total : %d €', $total)->eol();