55
66namespace Arc5 \Facade ;
77
8- use Mvc5 \Arg ;
98use Mvc5 \Service \Facade ;
109use Mvc5 \Template \TemplateLayout ;
1110use Mvc5 \Template \TemplateModel ;
1211
12+ use const Mvc5 \{ LAYOUT , RENDER , TEMPLATE_MODEL , VIEW_MODEL };
13+
1314trait View
1415{
1516 /**
@@ -24,7 +25,7 @@ trait View
2425 * @return TemplateLayout|mixed
2526 * @throws \Throwable
2627 */
27- static function layout (array $ vars = [], string $ template = null , string $ model = Arg:: LAYOUT ) : TemplateLayout
28+ static function layout (array $ vars = [], string $ template = null , string $ model = LAYOUT ) : TemplateLayout
2829 {
2930 return static ::model ($ vars , $ template , $ model );
3031 }
@@ -36,9 +37,9 @@ static function layout(array $vars = [], string $template = null, string $model
3637 * @return TemplateModel|mixed
3738 * @throws \Throwable
3839 */
39- static function model (array $ vars = [], string $ template = null , string $ model = Arg:: VIEW_MODEL ) : TemplateModel
40+ static function model (array $ vars = [], string $ template = null , string $ model = VIEW_MODEL ) : TemplateModel
4041 {
41- $ template && $ vars [Arg:: TEMPLATE_MODEL ] = $ template ;
42+ $ template && $ vars [TEMPLATE_MODEL ] = $ template ;
4243
4344 return !$ vars ? static ::plugin ($ model ) : static ::plugin ($ model )->with ($ vars );
4445 }
@@ -51,7 +52,7 @@ static function model(array $vars = [], string $template = null, string $model =
5152 */
5253 static function render ($ template , array $ vars = []) : string
5354 {
54- return static ::call (Arg:: RENDER , [$ template , $ vars ]);
55+ return static ::call (RENDER , [$ template , $ vars ]);
5556 }
5657
5758 /**
@@ -61,7 +62,7 @@ static function render($template, array $vars = []) : string
6162 * @return TemplateModel|mixed
6263 * @throws \Throwable
6364 */
64- static function template (string $ template = null , array $ vars = [], string $ model = Arg:: VIEW_MODEL ) : TemplateModel
65+ static function template (string $ template = null , array $ vars = [], string $ model = VIEW_MODEL ) : TemplateModel
6566 {
6667 return static ::model ($ vars , $ template , $ model );
6768 }
0 commit comments