Adding custom page

I think a router/controller system like symfony is not good for softwares that want to allow end-users to add a custom page to their system like whmcs? Or I am wrong?

Most custom page systems such as Wordpress or Joomla or whatever are pulling blog “article” or even page content from the database and then populating it into a (PHP, or whatever) file.

I don’t see how an MVC setup such as Symfony would be any different? You’d set up your view and populate it with content.

The routing and urls might be a bit trickier to set up, and of course you’d be building your own backend to allow posting and editing of custom content… but once it was all done, I guess it’d be fine?

Never done that though, and I don’t specifically use Symphony, so I could be off-base.

I have recently implemented an Apache feature which may be of interest.

I use PHP Laravel (MVC) Platform and selectively copy output pages to a cache directory and also created custom pages within the cache directory.

The root .htaccess file checks to see if the file exists in the cache directory and on success renders the relevant page. If the page does not exist then the request is routed to index.php. PHP, MYSQL, Laravel are then loaded …

1 Like

Would you share that .htaccess?

OK I will save you the effort of Googling for the solution and supply the relevant script so you can mindless copy and paste without doing the research but please read the following thread which is a the result of considerable time spent Googling, trying and testing for a satisfactory solution.

Today I had a eureka for making a page load faster

RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}/_YOUR_CACHE_DIRECTORY%{REQUEST_URI}.html -f
RewriteRule ^(.+)$ /_YOUR_CACHE_DIRECTORY/$1.html [QSA,L]

# OTHERWISE FALL-THROUGH TO PHP, MySQL, Laravel, etc

Please also note that pretty url’s are used and the web-pages must have a .html extension.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.