As the page is generated?

Hello. Explain to me please how the links are generated in cms, and how can this be done, if we are writing a website from scratch in pure php (for example, we need to create a new page in order to fill the film and attach description). Where to place the file with the page, because at the root of the website we discover.

Can only assume we create a single php file to output the desired information, and the page will be generated and modified using database queries. (that is, the user clicks on the image with the film, which is a reference, thereby submits a request to the database that contains the page name, description of the film, the film itself, etc.)

I would be grateful for a detailed response. Thank you.
July 2nd 19 at 14:05
3 answers
July 2nd 19 at 14:07
Solution
Well, You in the second paragraph answered your own question.
There is one php template for all films, for example, which is filled with the (video, description, title, comments, etc.) depending on the get request, which will be the record id
Thanks, that's what I wanted to hear. - dortha.Schmidt12 commented on July 2nd 19 at 14:10
July 2nd 19 at 14:09
Sometimes the page is present physically, the necessary information is simply passed GET parameters, but there is also another option, you can create like this .htaccess:
RewriteEngine On

# Some hosts may require you to use the `RewriteBase` directive.
# If you need to use the `RewriteBase` directive, it should be the
# absolute physical path to the directory that contains this htaccess file.
#
# RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]

And then any URL if there is no physical file or folder will not result in the 404 error and redirect to the index.php which, of course have the opportunity to determine what URL was requested and depending on it to return arbitrary content, you can implement arbitrary "virtual" URL with no physical address.
It is widely used in MVC frameworks, but could use a CMS as the MVC would be worth to implement in the CMS, not to "sculpt" them "monolithic" as Wordpress etc.
And WordPress never monolithic - dortha.Schmidt12 commented on July 2nd 19 at 14:12
You have something to compare something, you have a lot of CMS and frameworks seen? You neprofitni as an Evangelist, if you do not have many knowledge and experience with anything besides "his" instrument!
Alas, Wordpress is very little architectural layers, it is not built on the framework, and any "not monolithic" CMS needs to be built on the framework, for example on the MVC framework, the result in Wordpress plugins and especially the same code very often duplicated in different places.
OOP in Wordpress is little used. - Velva.Rogahn commented on July 2nd 19 at 14:15
: and what makes you think that I'm only familiar with WP? :) I 1997 kolbasu to PHP was Perl for another, and is familiar with OOP from other languages long before WP came to light. My conscious choice in favor of WP in recent years - is another question entirely. Do not write nonsense, you have horses-people mixed up. - mazie.Towne commented on July 2nd 19 at 14:18
All personal choice, but someone who is sane and understands the tool, and someone thinks it perfect and trying to impose it on everyone, even subconsciously.
"Sausage" can you at least since 1983, is not an indicator.
I repeat my arguments:
in Wordpress very little architectural layers
-it is not built on the framework, and any "not monolithic" CMS needs to be built on the framework, for example on the MVC framework,
- Wordpress plugins and especially the same code very often duplicated in different places.
If there are counter-arguments - write, and about your personal choice, length, etc is not the topic to write is not necessary - Velva.Rogahn commented on July 2nd 19 at 14:21
: Oh...
I repeat - you have horses-people mixed up. You are confusing the basic concepts that a lack of experience and uporotyh in some "supposedly ideologically correct" decision.

First, MVC != The PLO. Even more, in 99.99% of cases, Controller in MVC assumes too much that contradict the basic Single Responsibility Principle, and smearing a single entity for all three components - the model, controller and view, contradict another principle of encapsulation. In the world of experienced people who are not blinkered as you are, and remember languages are purely procedural, long discussion about what MVC is generally BAD DESIGN.
Second, MVC != a framework is a PATTERN Model-View-Controller. Pattern! The architectural pattern. One of the many, and not necessarily the only and true. This separation of business logic and display it, nothing more.
Thirdly, frameworks are written are not only implementing the MVC pattern. And not only OOP frameworks. Procedural programming was, is and will be. The PLO have their pros and cons, from your Procedural. It's not better/worse, it's different approaches.

So you understand, WordPress was originally written on the framework. Procedural implementing EVENT-DRIVEN pattern. Teach materiel.

But in WordPress a lot of the PLO (and gradually becoming more, not as fast as I would like - because of the enormous importance of backward compatibility, but still) and by itself, WP is a Content Management Framework with lots of built-in API, as any framework. And the top draped over a great admin. In fact, your only concern is the templating engine of WP, which, to the adherents of the MVC looks weird and old school. However, it is a matter of habit, a little ideology. To the real problems and their implementation it is any relation has no.

> in Wordpress are very few architectural layers
shta? Clarify what you mean.

PS: the Term "Monolithic CMS" not Google and the world knows nothing about it. Which again shows that you have mess in my head, mixed, horses, people, and you do not distinguish warm from soft.

ZZY: About the experience I wrote as a rebuttal to your ill-advised statement that in addition to WP I haven't seen. - mazie.Towne commented on July 2nd 19 at 14:24
July 2nd 19 at 14:11
Why did you decide to write your own engine for what has already been written a thousand times? Take a CMS and not wasting time in vain. Besides, you clearly lack even basic knowledge to implement the task. It's nothing personal.
I don't mind that you think so, but I would like to hear the answer to my question, if You still give it to me, then be so kind. - dortha.Schmidt12 commented on July 2nd 19 at 14:14
: Content is stored in the database. Each page has a unique ID and a type and an arbitrary number of auxiliary parameters from the actual content, to relations with other elements - menu items, taxonomies for grouping pages, metadata and so on. Then there is the application itself, which begins with the router - the index file-handler that parses the requested URL to a list of parameters and requests/downloads the required files from the functionality, templates and content from databases. It's in General. And so on each of the stages of an application there are lots of nuances, each of which can be implemented in different ways. There is not a single pattern, for example, referred to the MVC (Model - View - Controller). Here is the information for a book. - Velva.Rogahn commented on July 2nd 19 at 14:17

Find more questions by tags Web DevelopmentPHP