Commit e1cfff84 authored by karl's avatar karl
Browse files

Changes to the routing system, so that it routes every page using...

Changes to the routing system, so that it routes every page using PageController.php (does not work yet)
parent 8e0e9d4d
<?php
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
class PageController extends Controller
{
/**
* Load Startpage accordingly to the given URL-Parameter and Mobile
*
* @param int $id
* @return Response
*/
public function loadStartPage($locale = "de") {
\App::setLocale($locale);
return view('index', [ 'title' => 'MetaGer: Sicher suchen & finden, Privatsphäre schützen']);
}
public function loadSubPage($locale = "de", $page = "datenschutz") {
\App::setLocale($locale);
return view('$page', [ 'title' => 'MetaGer: Sicher suchen & finden, Privatsphäre schützen']);
}
}
\ No newline at end of file
......@@ -12,7 +12,18 @@
*/
# Unsere Startseite. Hier fängt alles an
Route::get('/{locale?}', [ 'uses' => 'StartpageController@loadStartPage']);
Route::get('{locale?}',
[ 'uses' => 'PageController@loadStartPage']
)
->where('locale', '[a-z]{1,2}');
# Unsere Startseite. Hier fängt alles an
Route::get('/{locale?}/{page}',
[ 'uses' => 'PageController@loadSubPage']
)
->where('locale', '[a-z]{1,2}');
# Unsere MetaGer Suche!!
Route::get('/meta/meta.ger3', [ 'uses' => 'MetaGerSearch@forwardToServer' ]);
Route::get('/meta/meta.ger3',
[ 'uses' => 'MetaGerSearch@forwardToServer' ]
);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment