<?php
use Joomla\CMS\Factory;
//for_use
require_once JPATH_ROOT . '/administrator/components/com_tmarlevv2/src/Helper/loader.php';
use Marlev\Component\Tmarlevv2\Administrator\Helper\ml_plugin_helper;
defined('_JEXEC') or die;
$app = Factory::getApplication();
$plugin_helper = new ml_plugin_helper();
$template = $app->getTemplate(true);
$get = $plugin_helper->get_layout($template->id, $template->template, $template);
if (is_array($get)) {
    foreach ($get as $key => $value) {
        $template->params->set($key, $value);
    }
}
?>
<!DOCTYPE html>

<html lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
<head>
    <title>404</title>
    <jdoc:include type="metas" />
    <jdoc:include type="styles" />
    <jdoc:include type="scripts" />
    <?php require 'lib/index_inc.php'; ?>

</head>
<body>
<div id='ml_body'>
<?php   $content->render(); ?>

<?php if ($this->debug) : ?>
<div class="container">
<div class="row"><div class="col-12">
        <h2><strong>Debug<strong></h2>
    <blockquote>
        <span class="badge bg-secondary text-center"><?php echo $this->error->getCode(); ?></span> <?php echo htmlspecialchars($this->error->getMessage(), ENT_QUOTES, 'UTF-8'); ?>
    </blockquote>
    <div>
        <?php echo $this->renderBacktrace(); ?>
        <?php if ($this->error->getPrevious()) : ?>
            <?php $loop = true; ?>
            <?php $this->setError($this->_error->getPrevious()); ?>
            <?php while ($loop === true) : ?>
                <p><strong><?php echo Text::_('JERROR_LAYOUT_PREVIOUS_ERROR'); ?></strong></p>
                <p><?php echo htmlspecialchars($this->_error->getMessage(), ENT_QUOTES, 'UTF-8'); ?></p>
                <?php echo $this->renderBacktrace(); ?>
                <?php $loop = $this->setError($this->_error->getPrevious()); ?>
            <?php endwhile; ?>
            <?php $this->setError($this->error); ?>
        <?php endif; ?>
    </div>
</div>
</div>
</div>
<?php endif; ?>
</body>
</html>
