PHP code example of zver / view

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

    

zver / view example snippets


  $html=View::loadFromString('{{ $caption}}<?=$caption2

  $html=View::loadFromFile($filename)
                ->set('caption', 1)
                ->render();

  $html=View::load($filenameOrString)
                ->set('caption', 1)
                ->render();

   View::addViewsDirectory(dir1);
   View::addViewsDirectory(dir2);
   View::addViewsDirectory(dir3); <--- added last

 View::load('view3');          <---- dir1/view3
 View::load('view1');          <---- dir3/view1 because it's added last
 View::load('dir4/view1');     <---- dir4/view1

\dir3
	\view1.php
\dir2
    \dir4
        \view1.php
	\view1.php
	\view2.php
\dir1
	\view1.php
	\view3.php