Hello to all.

There is a certain page with links to other pages, but other pages should be generated by clicking on the link, that is, have one common template. The problem is that although the essence of these pages is the same, but the number of identical elements on each page is different. We need to somehow figure out how to implement it. I imagine it this way: we click on the link, a function is started that parses the text file and gets the number of elements, the names and description of them from there. So we get the html page with our active elements.

How can this be smarter and simpler? It turns out that anyway, we need to fill in a text file according to certain rules. This is better than keeping 300 html pages or 300 functions for each. Or am I wrong? Or something I do not understand) Thank you.

  • Use the CMS (content management system), it's too early for you to write a self-written site in pure php - Dmitry Gvozd
  • You need to become familiar with the theory of Object Oriented Programming and the MVC approach. On the fingers of this you can not explain. - ALexander

1 answer 1

The truth is somewhere nearby. Take the ready engine, maybe WordPress will suit you, read about it, consider the possibility of studying and further implementing your project on this engine. If not, consider different php frameworks, for example yii2 or laravel. They have a low threshold of entry, it is easy to master the basics necessary for the implementation of a small project. The principle you set out somewhere almost true. You need a single entry point, a function or an object that will look at the address at which the user passed and decide what to do, which template and how to collect, and all the necessary data is stored in the database on the server. No text files are needed, this is too complicated and not rational. Everything has been invented for you a long time ago, I will give several useful links on the above materials: https://yiiframework.com.ua/ru/doc/guide/2/start-installation/ http://www.yiiframework.com/doc/ guide / 1.1 / en / quickstart.what-is-yii https://laracasts.com/series/laravel-5-fundamentals - really cool videos from the developer laravel, true in English. https://ru.wordpress.org/ https://www.youtube.com/watch?v=cyDQwy63fMw - Video meeting with wordpress

Good luck to you!