Skip to content

Instantly share code, notes, and snippets.

@Petah
Last active January 31, 2016 15:57
Show Gist options
  • Save Petah/1362b6227ca928c66af0 to your computer and use it in GitHub Desktop.
Save Petah/1362b6227ca928c66af0 to your computer and use it in GitHub Desktop.
2-cms
<?php
$view = preg_replace('/[^a-z]/', '', $_SERVER['REQUEST_URI']) ?: 'index';
require __DIR__ . '/layout.php';
<html>
<body>
<?php require __DIR__ . '/views/' . $view . '.php'; ?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment