Skip to content

Instantly share code, notes, and snippets.

@hiromi2424
Created January 7, 2011 14:20
Show Gist options
  • Save hiromi2424/769498 to your computer and use it in GitHub Desktop.
Save hiromi2424/769498 to your computer and use it in GitHub Desktop.
webroot controller
<?php
class WebrootController extends AppController {
var $uses = null;
var $_ext = '.php';
function show() {
$path = func_get_args();
$path = implode(DS, $path);
if (in_array($path, array('index', 'css', 'test'))) {
$this->redirect(null, 404);
}
$this->render(null, null, WWW_ROOT . $path . $this->_ext);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment