OpenSource CLI-App to install and handle stuff related to Web-Server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

46 lines
742 B

<?php
namespace App;
use Jenssegers\Blade\Blade;
/**
*
*
*
*
*/
class BladeFile
{
// cache dir
const CACHE_DIR = '/storage/cache';
// blade engine
private $blade;
/**
*
*
*
* @param {string} $templateDir
*
*/
public function __construct($templateDir)
{
$this->blade = new Blade(base_path().$templateDir, base_path().self::CACHE_DIR);
}
/**
* put to file
*
* @param {string} $template
* @param {string} $fullpath
* @param {array} $data
*
*/
public function put($template, $fullpath, $data)
{
$content = $this->blade->render($template, $data);
file_put_contents($fullpath, $content);
}
}