[php]<?php
declare(strict_types=1);
namespace TIMS\application\controller;
require_once("…/config/config.php");
use TIMS\application\model\Company;
class CompanyController
{
private $objCompany = null;
function __construct()
{
}
public function index()
{
try
{
$objCompany = new Company($pdo);
$viewcompany = $objCompany->getAllCompany();
echo $viewcompany;
require APP . 'view/_templates/header.php';
require APP . 'view/Company/Create.php';
require APP . 'view/_templates/footer.php';
}
catch(\Exception $e)
{
error_log($e->getMessage());
exit('Something weird happened');
}
}
}
$obj = new CompanyController();
$obj->index();
?>
[/php]