1

I am building an app in fuelphp, and I'd like to route to a page of fully static content. For example, I have a file I'd like to display in public/assets/html/pages/mypage.html, but i'd like to see that static content when I navigate to localhost/myroute.

How can I write a route that does this?

johncorser
  • 9,262
  • 17
  • 57
  • 102

1 Answers1

2

'myroute' => function () { return file_get_contents(DOCROOT.'assets/html/pages/mypage.html'); }

kenjis
  • 664
  • 3
  • 7
  • This is indeed the answer, if you need some dynamic logic to route to content. If not, you'd better use webserver rewritting. – mark.sagikazar Apr 02 '15 at 16:18