Skip to content

Commit

Permalink
upgrade to attogram/router ^4
Browse files Browse the repository at this point in the history
  • Loading branch information
attogram committed Apr 6, 2019
1 parent 97e443c commit 17cbe6e
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 19 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
},
"require": {
"attogram/router": "^1.0",
"attogram/router": "^4.0",
"php": "^7.0"
}
}
33 changes: 20 additions & 13 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/BodyMassInfoTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class BodyMassInfoTable
use TemplateTrait;

/** @var string Version*/
const VERSION = '2.1.0';
const VERSION = '2.1.1.pre.0';

/** @var Router */
private $router;
Expand All @@ -33,6 +33,7 @@ public function route()
$this->router = new Router();
$this->router->allow('/', 'home');
$this->router->allow('/about', 'about');
/** @var string|null $match */
$match = $this->router->match();
if ($match) {
$this->routePage($match);
Expand Down
4 changes: 2 additions & 2 deletions templates/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
<footer>
<br />
<div class="hdr bw bold">
<a href="<?= $this->router->getUriBase(); ?>/">Body Mass Info Table v<?= BodyMassInfoTable::VERSION; ?></a>
<a href="<?= $this->router->getHome() ?>">Body Mass Info Table v<?= BodyMassInfoTable::VERSION; ?></a>
&nbsp;&nbsp;
<a href="<?= $this->router->getUriBase(); ?>/about/">About</a>
<a href="<?= $this->router->getHome() ?>about/">About</a>
&nbsp;&nbsp;
<a href="https://github.com/attogram/body-mass-info-table" target="github">Github</a>
</div>
Expand Down
4 changes: 2 additions & 2 deletions templates/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</style></head><body>
<div class="container-fluid">
<div class="hdr bw bold">
<a href="<?= $this->router->getUriBase(); ?>/">Body Mass Info Table</a>
<a href="<?= $this->router->getHome() ?>">Body Mass Info Table</a>
&nbsp;&nbsp;
<a href="<?= $this->router->getUriBase(); ?>/about/">About</a>
<a href="<?= $this->router->getHome() ?>about/">About</a>
</div>

0 comments on commit 17cbe6e

Please sign in to comment.