PHP code example of pkit / phantom

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

    

pkit / phantom example snippets


use Pkit\Phantom;
use Pkit\View;

# ".\view" is the default directory, and views are discovered without file extension
return Phantom::render("page", ["var" => $value]);
/***/
return Phantom::renderView(new View(/* path */), "dir/page");

<? use Pkit\Phantom 

# ./view/component.phtml
component
<?= $var 

# ./view/master.phtml
<? use Pkit\Phantom 

# ./view/master.phtml
<? use Pkit\Phantom 

<? use Pkit\Phantom