File: /home/undanet/www/PortalEmpleo/src/Utils/Load.php
<?php
namespace PortalEmpleo\Utils;
require __DIR__ . '/../../vendor/autoload.php';
require_once __DIR__ . '/../../bootstrap.php';
use Dotenv\Dotenv;
class Load
{
public function __construct()
{
}
function view ($file_name, $data = null)
{
if (is_array($data))
{
extract($data);
}
include __DIR__ . '/../Views/'.$file_name;
}
function loadEnv()
{
try{
$dotenv = Dotenv::createImmutable(__DIR__ . "/../../");
$dotenv->load();
return true; //$_ENV;
}
catch (Exception $ex){
echo $exception->getMessage();
return null;
}
}
}
?>