PHP code example of transitive / simple

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

    

transitive / simple example snippets




use Transitive\Core\Presenter;
use Transitive\Simple\View;

$presenter = new Presenter();
$presenter->addData('name', 'Transitive');

$view = new View();
$view->setTitle('Home');
$view->addContent(function (array $data) {
	return 'Hello '.$data['name'];
});
$data = $presenter->getData();
$view->setData($data);

echo $view->getTitle('', '', PHP_EOL);
echo $view->getContent()->asString();