Last active
August 29, 2015 14:26
-
-
Save bobmagicii/ab9bd36fa7d40651fca1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$router = (new Nether\Router) | |
->AddRoute('{@}//post/(#)','Routes\Post::ViewByID') | |
->AddRoute('{@}//admin/post(#)','Routes\Admin\Post::ViewByID'); | |
try { $router->Run(); } | |
catch(...) { } | |
catch(...) { } | |
catch(...) { } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Routes; | |
use \Nether; | |
class Post | |
extends Nether\Avenue\PublicAPI { | |
public function | |
ViewByID($id) { | |
// ... | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Routes\Admin; | |
use \Nether; | |
// if admin view is vastly different. | |
class Post | |
extends Nether\Avenue\PrivateAPI { | |
public function | |
ViewByID($id) { | |
// ... | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Routes\Admin; | |
use \Routes; | |
// if admin view is almost the same. | |
class Post | |
extends Routes\Post { | |
public function | |
ViewByID($id) { | |
$this->RequireAdmin(); | |
// ... | |
return parent::ViewByID($id); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment