Automatic creation of links/pages?

I started to create a website (my first website, so the question is noob) in HTML CSS js and a little php, and have encountered a problem - I have to create all the links manually, for example I created a page template content, I have 30 categories, and therefore need to duplicate the 30 similar pages, you can put on them different content (and that too manually, with HTML as well I don't know). How do I get rid of these problems? Can use laravel or zend framework after reviewing them?
July 9th 19 at 10:28
4 answers
July 9th 19 at 10:31
Solution
Make a php file which will contain an array of descriptions of all pages.
Then do a include_once that file in ready page - parsite it and get all the links...

An example file:
<?php
$config = [
[
 'name' =--> 'page_one',
 'title' => 'first page',
],
[
 'name' => 'page_two',
 'title' => 'second page',
],
];
?>

Then take into service a standard class-wrapper IteratorIterator, in order to bypass the array and get the desired values...
July 9th 19 at 10:33
no.
1. it is necessary to use the "shitie" page of the pieces via include in php
there is header, content, footer this is all in separate files, etc.
2. you can implement through SPA and ship a single piece of html menu for different pages using ajax
1 . I already crawled 2.can SPA in expanded form? - roger28 commented on July 9th 19 at 10:36
SPA - single page application, ajax is all roughly speaking - Henderson_Beat commented on July 9th 19 at 10:39
July 9th 19 at 10:35
You might learn some principles of creating websites. It is desirable to write the first guest book on php without a framework, and then to undertake for them.
July 9th 19 at 10:37
1. Read, understand, and use MCV
2. It is advisable to read, understand and use OOP in PHP

Basically You need a component (php code) that will connect to index.php and to resolve the queries using some of your rules. In this server, all the queries will guide through the index.php.

If all the above "hard" or have no desire to masturbate - use framework, where this has already been implemented, for example Yii2 or laravel. I think yii2 easier to start

Find more questions by tags CSSCMSFrameworksHTMLFrontend