PHP Classes

File: views/frontend/page/view.php

Recommend this page to a friend!
  Classes of Gabriel Alejandro López López   Yii2 Static Pages Module   views/frontend/page/view.php   Download  
File: views/frontend/page/view.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Yii2 Static Pages Module
Generate static pages for a Yii2 Web application
Author: By
Last change:
Date: 8 days ago
Size: 521 bytes
 

Contents

Class file image Download
<?php

use yii\helpers\Html;

?>

<article>
    <header>
        <h1><?= Html::encode($model->title) ?></h1>
    </header>

    <?= call_user_func($this->context->module->formatter, $model->body) ?>

    <?php if ($model->getPages()->exists()): ?>

        <h2><?= Yii::t('staticpages', 'Sub pages') ?></h2>
        <ul>
            <?php foreach ($model->pages as $page): ?>
<li><?= Html::a($page->title, $page->url)?></li>
            <?php endforeach; ?>
</ul>

    <?php endif; ?>

</article>