PHP code example of litphp / view-php

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

    

litphp / view-php example snippets


Hello <?=name

$configuration+=\Lit\View\Php\PhpView::configuration([__DIR__.'/templates']);

abstract class BaseAction extends BoltAbstractAction
{
    use \Lit\View\Php\PhpViewBuilderTrait;

class HomeAction extends BaseAction
{
    protected function main(): ResponseInterface
    {
        return $this->template('index.phtml')->render(['name' => 'native php']);
    }
bash
composer