diff options
author | Malf Furious <m@lfurio.us> | 2018-07-24 06:07:05 -0400 |
---|---|---|
committer | Malf Furious <m@lfurio.us> | 2018-07-24 06:07:05 -0400 |
commit | 9e5ff3763ad4f8d62f410e57aa661675146ac863 (patch) | |
tree | 0a92cce1c9a2cdf77ee6e21a03babafd19d1e761 | |
parent | 3a5c526c38fc823e393330ae3f9dad74342b3f1f (diff) | |
download | scrott-9e5ff3763ad4f8d62f410e57aa661675146ac863.tar.gz scrott-9e5ff3763ad4f8d62f410e57aa661675146ac863.zip |
Move $user page object scope
Since several routes will use the current $user as the PAGE_OBJECT, I'm
just setting it once above most of the logic. Any route that needs
something else can change it.
There's a condition in the setPageObj() function that throws if we
attempt to call it more than once. I'm thinking this can be removed
it's not protecting from much.
-rw-r--r-- | app/index.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/index.php b/app/index.php index 63ad931..b0b191f 100644 --- a/app/index.php +++ b/app/index.php @@ -42,10 +42,11 @@ function main(array $argv) : void return; } + setPageObj($user); + /* no arguments? display dashboard */ if (count($argv) == 0) { - setPageObj($user); setPageName("<i>Dashboard</i>"); require "view/dashboard.php"; return; |