[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [websites/reservoir/develop] app/controllers: try a completely different approach for including view
From:       Ingo Malchow <imalchow () kde ! org>
Date:       2014-10-29 20:39:48
Message-ID: E1Xja20-0003r5-Ev () scm ! kde ! org
[Download RAW message or body]

Git commit 85bcb150e78c372c141a461ea9842b0539da6bc1 by Ingo Malchow.
Committed on 29/10/2014 at 20:39.
Pushed by imalchow into branch 'develop'.

try a completely different approach for including views
instead of testing against an array of possible viewable files just check if file exists.
The difference: now you can not decide if a file is viewable or not. file exists so it is viewable.
Depends on the promo folks which way they prefer.

M  +4    -3    app/controllers/HomeController.php

http://commits.kde.org/websites/reservoir/85bcb150e78c372c141a461ea9842b0539da6bc1

diff --git a/app/controllers/HomeController.php b/app/controllers/HomeController.php
index a6bd73f..2fac7f9 100644
--- a/app/controllers/HomeController.php
+++ b/app/controllers/HomeController.php
@@ -25,10 +25,11 @@ class HomeController extends BaseController {
     public function showPage($page)
     {
         $theme = Theme::uses(Config::get('reservoir.theme'))->layout('default');
-        if(in_array($page, Config::get('reservoir.pages'))){
+        
+        if (View::exists($page))
+        {
             return $theme->watch($page)->render();
-        }
-        else {
+        } else {
             App::abort(404);
         }
     }
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic