Add helper for the skin view
This commit is contained in:
parent
0c7117da6c
commit
4fb8a1aaf9
@ -15,11 +15,12 @@ class Controller extends BaseController
|
||||
* Display a view but pull it from the active skin
|
||||
* @param string $template
|
||||
* @param array $vars
|
||||
* @param array $merge_data
|
||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||
*/
|
||||
public function view(string $template, array $vars=[])
|
||||
public function view($template, array $vars=[], $merge_data=[])
|
||||
{
|
||||
$tpl = 'layouts/' . config('phpvms.skin') . '/' . $template;
|
||||
return view($tpl, $vars);
|
||||
return view($tpl, $vars, $merge_data);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,18 @@
|
||||
<?php
|
||||
|
||||
if (!function_exists('skin_view')) {
|
||||
/**
|
||||
* Render a skin
|
||||
* @param $template
|
||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||
*/
|
||||
function skin_view($template, array $vars = [], $merge_data = [])
|
||||
{
|
||||
$tpl = 'layouts/' . config('phpvms.skin') . '/' . $template;
|
||||
return view($tpl, $vars, $merge_data);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Shortcut for retrieving a setting value
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user