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.
 
 
 

49 lines
940 B

<?php
namespace App;
use Jenssegers\Blade\Blade;
/**
* wrapper for blade
*
*
* @author Björn Hase, Tentakelfabrik
* @license http://opensource.org/licenses/MIT The MIT License
* @link https://gitea.tentakelfabrik.de/Tentakelfabrik/mcp
*
*/
class BladeFile
{
// cache dir
const CACHE_DIR = '/storage/cache';
// blade engine
private $blade;
/**
* create 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);
}
}