@@ -55,16 +55,6 @@ function auth($guard = null)
5555 }
5656}
5757
58- if (!function_exists ('d ' )) {
59- /**
60- * Return Leaf's date object
61- */
62- function d ()
63- {
64- return app ()->date ;
65- }
66- }
67-
6858if (!function_exists ('dbRow ' )) {
6959 /**
7060 * Return a db row by it's id
@@ -105,16 +95,6 @@ function email(array $email)
10595 }
10696}
10797
108- if (!function_exists ('fs ' )) {
109- /**
110- * Return Leaf's FS object
111- */
112- function fs ()
113- {
114- return app ()->fs ;
115- }
116- }
117-
11898if (!function_exists ('flash ' )) {
11999 /**
120100 * Return Leaf's flash object
@@ -213,34 +193,3 @@ function setHeader($key, $value = "", $replace = true, $code = 200)
213193 app ()->headers ()->set ($ key , $ value , $ replace , $ code );
214194 }
215195}
216-
217- if (!function_exists ("view " )) {
218- function view (string $ view , array $ data = [])
219- {
220- if (ViewConfig ("render " )) {
221- ViewConfig ("config " )([
222- "views_path " => AppConfig ("views.path " ),
223- "cache_path " => AppConfig ("views.cachePath " ),
224- ]);
225-
226- return ViewConfig ("render " )($ view , $ data );
227- }
228-
229- $ engine = ViewConfig ("view_engine " );
230-
231- $ className = strtolower (get_class (new $ engine ));
232-
233- $ fullName = explode ("\\" , $ className );
234- $ className = $ fullName [count ($ fullName ) - 1 ];
235-
236- if (forward_static_call_array (["Leaf \\View " , $ className ], [])) {
237- forward_static_call_array (["Leaf \\View " , $ className ], [])->configure (AppConfig ("views.path " ), AppConfig ("views.cachePath " ));
238- return forward_static_call_array (["Leaf \\View " , $ className ], [])->render ($ view , $ data );
239- }
240-
241- $ engine = new $ engine ($ engine );
242- $ engine ->config (AppConfig ("views.path " ), AppConfig ("views.cachePath " ));
243-
244- return $ engine ->render ($ view , $ data );
245- }
246- }
0 commit comments