I'm currently creating a webpage and I have a problem, which I couldn't find answer for. I'm using Laravel framework and I need to store pages somehow. I would normally use MySQL or SQLite or some other DB engine like that, but some of the pages I write contain PHP code.
Specifically, page /app downloads something from somewhere using file_get_contents, does magic with converting encoding and displays the downloaded content. Page / is just plain Html. I thought about using eval() but it seems like an extreme overkill and insecurity to me. Also I would like to leverage the MVC somehow in this by having the logic of /app in controller and the text of the page in some DB. So I need to find some type of model which would allow me to this.
I'm using the "function-per-page" approach. i.e.
Class MainController extends BaseController {
public function getIndex() { // some code }
public function getApp() { // some code }
public function getDocs() { // some code }
}
etc...
Any ideas on how to deal with it?
EDIT:
A little bit of background. I'm not a newbie, it is just that I don't know how to deal with this project. I have experience in writing projects like blogs using Laravel.
The page I'm creating is "portfolio-type"; mostly static, but 2 pages contains scripts as stated above. Also I already have working version, but I'm rewriting it from scratch. Original version used Slim framework and pages were stored as php files, then included to template based on url.
include "pages/$url_part.inc.php";