Created
June 24, 2015 02:26
-
-
Save jackfruh/111f9eacf9b5b04e91c8 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
class ColorController extends Controller { | |
/** | |
* Display a listing of the resource. | |
* | |
* @return Response | |
*/ | |
public function index() | |
{ | |
// if you uncomment the next two lines, it will save the output to colors.html in the laravel public/cache folder | |
// (I added the cache folder as a subfolder of public, it's not there by default | |
// you can load it from the browser from http://website/public/cache/colors.html | |
// $var = view('admin.colors.index')->with('colors', \App\color::paginate(10)); | |
// file_put_contents('/Users/jack/Desktop/WebFiddle.test/Laravel5s/scratchpad/public/cache/colors.html',$var); | |
// this one returns in about 195ms on my laptop. | |
// you can load it from the browser via http://website/routetocolorscontroller/ | |
return view('admin.colors.index')->with('colors', \App\color::paginate(10)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment