FEATURE: add blade template registration into templates

This commit is contained in:
Michal Kváček
2016-09-20 11:50:41 +02:00
parent f087da1b43
commit d43073a011
17 changed files with 191 additions and 108 deletions
+16 -3
View File
@@ -21,10 +21,8 @@ class Template
$namespace .= '::';
}
$theme = config('app.theme');
// list of prefixes
$prefixes = [$theme . '.custom.', $theme . '.', ''];
$prefixes = ['custom.', ''];
$view = null;
foreach ($prefixes as $prefix) {
@@ -59,6 +57,13 @@ class Template
return config('app.upload_url') . '/' . $filename;
}
/**
* Get path to given asset
*
* @param $path
*
* @return string
*/
public static function asset($path)
{
if (env('APP_DEBUG')) {
@@ -75,6 +80,14 @@ class Template
return config('app.url') . '/assets/' . config('app.theme') . '/' . $path;
}
/**
* Print date in configured format
*
* @param $datestamp
* @param bool $withTime
*
* @return false|string
*/
public static function date($datestamp, $withTime = true)
{
$timestamp = strtotime($datestamp);