Add helper for the skin view
This commit is contained in:
@@ -15,11 +15,12 @@ class Controller extends BaseController
|
|||||||
* Display a view but pull it from the active skin
|
* Display a view but pull it from the active skin
|
||||||
* @param string $template
|
* @param string $template
|
||||||
* @param array $vars
|
* @param array $vars
|
||||||
|
* @param array $merge_data
|
||||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
* @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;
|
$tpl = 'layouts/' . config('phpvms.skin') . '/' . $template;
|
||||||
return view($tpl, $vars);
|
return view($tpl, $vars, $merge_data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,18 @@
|
|||||||
<?php
|
<?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
|
* Shortcut for retrieving a setting value
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user