PHP code example of tuum / view

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

    

tuum / view example snippets


$view = new Tuum\View\Renderer(
    new Tuum\View\Locator('/path/to/view/')
); // or alternatively,
$view = Tuum\View\Renderer::forge('/path/to/view');

$view->render('my/file-name', [ 
  'some' => 'data' 
]);

<html>
Some=<?= $some; 

$viewer = $viewer->setLayout('layout/layout1');
$viewer->render('file-name', [ 
  'some' => 'data' 
]);


$this->setLayout('layout/layout1');

This is layout#1.
<?= $this->section-getContent(); 

 $this-> section->start(); 

Block:
<?= $this->section->get('block'); 

 if ($this->section->exists('content')): 

 $this->section->start(); 

 $this->section->markNotToRender('bread'); 

 $this->section->start(); 

<?= $this->block('block-sub', ['some' =>'value']); 

 $this->blockAsSection('block-file', 'section-name', ['another' => 'one']); 
$this->getContent()
$this->section->start()
$this->section->saveAs('block')