Your IP : 216.73.216.79


Current Path : /var/www/html/crowdfunding/frontend/views/layouts/
Upload File :
Current File : /var/www/html/crowdfunding/frontend/views/layouts/main.php

<?php
/* @var $this \yii\web\View */
/* @var $content string */
/* @var $param yii\base\View*/
use common\components\PortalDBContent;
use common\components\PortalRouting;
use yii\helpers\Html;
// use Hashids\Hashids;

$__dyna_dev_environment = YII_ENV === 'dev' ? true : false;

$routing = new PortalRouting();

// error routing
if($routing::isRouteError()) {
    if($__dyna_dev_environment) {
        die($content);
    } else {
        die($this->render('404'));
    }
}


$this->title = 'Manage Center';

?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<?php
//begin page
$this->beginPage(); 
// register csrf
$this->registerCsrfMetaTags();

if (!$routing::isFrontendControllerMethod()) :

	$page_object = null;

// switch route base on routing rule
switch (true) {
    case $routing::isLanding():
        $page_object = $routing::getlandingPage();
        break;
    
    case $routing::isBasedOnId():
        $page_object = $routing::getPageObjectBaseOnId();
        break;
        
    case $routing::isPrettyUrl():
        $page_object = $routing::getPageBasedOnSlug($this->context->DYNAWEB_DEFAULT_ROUTE_PAGE, $this->context->DYNAWEB_DEFAULT_ROUTE_PARAMS);
        break;    
}

// db direct render
$db_render = new PortalDBContent([
        'page_id'  => $page_object->page_id,
        'theme_id' => $page_object->theme_id ?? 0,
        'page_object' => $page_object, // object
        'env' => $__dyna_dev_environment
    ]
);


$db_render::fileRender();

// $db_render::render();

$this->endPage();

/* show the content of routes */
else : 
?>
<?php $this->beginPage() ?>
<head>
    <meta charset="<?= Yii::$app->charset ?>">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <?php $this->registerCsrfMetaTags() ?>
    <title><?= Html::encode($this->title) ?></title>
    <?php $this->head() ?>
</head>
<body>
<?php $this->beginBody() ?>

<div class="wrap">
    <?= $content?>
</div>
<!-- end checking for routes -->
<?php $this->endBody() ?>
<?php $this->endPage() ?>
<?php endif; ?>
</body>
</html>