PHP code example of millancore / view-element

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

    

millancore / view-element example snippets



<ul id="<?= $id ?? '' 

 Vx\View::start('template_list.php', [ 'id' => 'list']) 

 VxStart('template_list.php', [ 'id' => 'list']) 

$viewResolver = Vx\Resolver::getInstance();

$viewResolver->config(new Vx\Config([
     'viewDir' => __DIR__ . DIRECTORY_SEPARATOR  . 'views',
     'extension' => false
]));


$viewResolver = Vx\Resolver::getInstance();

$viewResolver->addFilter('upper', fn($string) => strtoupper($string));

<h1> <?= VxFilter('mi name', 'upper')