PHP code example of mindplay / kisstpl

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

    

mindplay / kisstpl example snippets


$service = new ViewService(new SimpleViewFinder('my/app/views', 'app\view'));

$hello = new \app\view\HelloWorld();

$service->render($hello); // -> "my/app/views/HelloWorld.view.php"

$service->render($hello, 'boom'); // -> "my/app/views/HelloWorld.boom.php"
$service->render($hello, 'bang'); // -> "my/app/views/HelloWorld.bang.php"



use app\view\HelloWorld;

/**
 * @var HelloWorld $view
 */


use app\view\HelloWorld;
use mindplay\kisstpl\Renderer;

 return function(HelloWorld $view, Renderer $renderer) { 



use app\view\HelloWorld;
use mindplay\kisstpl\ViewService;

/**
 * @var HelloWorld $view
 * @var ViewService $this
 */

$view->layout->title = 'My Page!';

$this->begin($view->layout->body);


$content = $service->capture($hello);