Closed nasrulhazim closed 8 years ago
Propose theme helper syntax:
reponse()->theme('theme_name')->render('home.index', compact('users'));
OR
theme('theme_name')->render('home.index', compact('users'));
Set different layout during runtime is possible
theme('theme_name')->layout('mail')->render('home.index', compact('users'));
Yes, there is a helper.
if ( ! function_exists('theme'))
{
/**
* Get the theme instance.
*
* @param string $themeName
* @param string $layoutName
* @return \Teepluss\Theme\Theme
*/
function theme($themeName = null, $layoutName = null)
{
$theme = app('theme');
if ($themeName)
{
$theme->theme($themeName);
}
if ($layoutName)
{
$theme->layout($layoutName);
}
return $theme;
}
}
Hi there,
Is it possible to have a helper for the theme?
Usage will be something similar to
response()->json(...)
, but for theme probably usingresponse()->theme()->scope(...)