Created
November 5, 2012 07:00
-
-
Save sineld/4015717 to your computer and use it in GitHub Desktop.
Twitter username style urls: twitter.com/sineld
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 | |
| // Source: http://www.everyonecanweb.com/snippet/view/28 | |
| Route::filter('before', function() | |
| { | |
| // Direct user to clouddueling.com/nickname | |
| $nickname = URI::segment( 1 ); | |
| if( !in_array( $nickname, Controller::detect() ) ) | |
| { | |
| $user = User::where_nickname( $nickname )->first(); | |
| if( !is_null( $user ) ) | |
| return Controller::call( 'user@profile', array( $user->id ) ); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment