PHP code example of blade / debugm2o

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

    

blade / debugm2o example snippets



return [
    'providers' => [
        //some some some provider
        'Blade\DebugM2O\DebugProvider'
    ]
];


define('ROOT', dirname(__DIR__));
define('CACHE_ROOT', ROOT . '/cache');
define('VIEW_ROOT', ROOT . '/view');

 Container;
$blade = new Blade(VIEW_ROOT, CACHE_ROOT, $container);
$config = $container['config'];
//兼容下独立blade包无法正常读取 view.xx的bug
$config['view'] = [
    'paths' => $blade->viewPaths,
    'compiled' => $blade->cachePath
];
$container['config'] = $config;

(new DebugProvider($container))->register();
echo $blade->make($path, array(/*页面数据*/))->render();