phug-php/tester

View on GitHub
src/template/file.html

Summary

Maintainability
Test Coverage
<?php

$subPaths = preg_split('/[\\\\\\/]+/', "/$path");
$file = array_pop($subPaths);
$up = count($subPaths) - 1;
$cssPath = str_repeat('../', $up).'css';

?><!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title><?=$path?></title>
    <link rel="stylesheet" href="<?=$cssPath?>/bootstrap.min.css">
    <link rel="stylesheet" href="<?=$cssPath?>/style.css">
</head>
<body>
<header>
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <ol class="breadcrumb">
                    <?php
                    foreach ($subPaths as $index => $subPath) {
                        $up = count($subPaths) - $index - 1;
                        ?>
                        <li><a href="<?=str_repeat('../', $up)?>index.html"><?=$subPath ?: '(root)'?></a></li>
                        <?php
                    }
                    ?>
                    <li class="active"><?=$file?></li>
                </ol>
            </div>
        </div>
    </div>
</header>
<div class="container">
    <div class="pre"><?=$coverage?></div>
    <footer>
        <hr/>
        <p>
            <small>Generated by <a href="https://github.com/phug-php/tester" target="_top">phug/tester <?=$phugTesterVersion?></a> using <a href="https://secure.php.net/" target="_top">PHP <?=PHP_VERSION?></a> with <a href="https://xdebug.org/">Xdebug <?=phpversion('xdebug')?></a> and <a href="https://phpunit.de/">PHPUnit <?=\PHPUnit\Runner\Version::id()?></a> at <?=date('r')?>.</small>
        </p>
    </footer>
</div>
</body>
</html>