Created
April 13, 2014 16:59
-
-
Save snetty/10592545 to your computer and use it in GitHub Desktop.
example laravel controller with ajax detection
This file contains 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
public static function view($view){ | |
return 'base.' . (Request::ajax() ?: 'ajax.') . $view; | |
} | |
public function create() | |
{ | |
return View::make(self::view('create'), $this->viewVars()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment