Update Framework
This commit is contained in:
parent
06f17dff5b
commit
69f3313f0f
19 changed files with 974 additions and 35 deletions
35
src/Runtime/Helpers/helpers.php
Normal file
35
src/Runtime/Helpers/helpers.php
Normal file
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
use Runtime\Bootstrap;
|
||||
use Runtime\Http\Views\Factory as ViewFactory;
|
||||
|
||||
if(!function_exists('app'))
|
||||
{
|
||||
/**
|
||||
* @param null $abstract
|
||||
* @return mixed|Container
|
||||
*/
|
||||
function app($abstract = null)
|
||||
{
|
||||
if (is_null($abstract)) {
|
||||
Bootstrap::getInstance();
|
||||
}
|
||||
|
||||
return Bootstrap::getInstance()->make($abstract);
|
||||
}
|
||||
}
|
||||
|
||||
if(!function_exists('view'))
|
||||
{
|
||||
/**
|
||||
* @param $name
|
||||
* @param array $arguments
|
||||
* @return mixed
|
||||
*/
|
||||
function view($name, $arguments = [])
|
||||
{
|
||||
$factory = app(ViewFactory::class);
|
||||
|
||||
return $factory->make($name, $arguments);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue