PHP code example of plansys / yard

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

    

plansys / yard example snippets


 
 
 $host = str_replace("index.php", "", strtok($_SERVER["REQUEST_URI"], '?'));
 return [
    'name' => 'PLANSYS',
    'offline' => false,
    'settings' => null,
    'host' => $host,
    'modules' => [
        '' => [
            'dir'=> dirname(__FILE__) . '/pages',
            'url' => $host . '/pages',
            'redux' => dirname(__FILE__) . '/redux'
        ]
    ],
    'dir' => [
        'dir'=> dirname(__FILE__) . '/pages',
        'base' => dirname(__FILE__) . '/vendor/plansys/yard/base/build',
        'cache' => dirname(__FILE__) . '/tmp',
        'root' => dirname(__FILE__) 
    ],
    'url' => [
        'base' => $host . '/vendor/plansys/yard/base/build',
        'cache' => $host . '/tmp/[file]',
        'page' => $host . '/index.php?p=[page]',
    ]
 ];
 



 = new \Yard\Base(dirname(__FILE__) . DIRECTORY_SEPARATOR . "base.php");
$yard = new \Yard\Renderer($base);

$parr = explode('...', @$_GET['p']);
$modearr = count($parr) > 1 ? explode(".", $parr[1]) : [''];
$mode = count($modearr) > 1 ? $modearr[1] : $modearr[0];

if ($mode == 'css') {
    header('Content-type: text/css');
} else if (in_array($mode, ['js', 'jsdev', 'sw'])) {
    header('Content-type: text/javascript');
}
$page = isset($_GET['p']) ? $_GET['p'] : 'builder:Index';
echo $yard->render($page);