Require info to implement html website into php MVC

Hello, I have created a simple php Model View Controller (MVC).

[ul][li]In the controller folder I have controller.php[/li]
[li]In the model folder I have model.php, page.php and dbconnect.php file[/li]
[li]In the view folder I have pages.php and viewpage.php[/li][/ul]

In the database I have populated a pages table with columns PageID, Page Title, Image, Description.

What I need to know is, how do I implement my existing website template into this MVC? I think I understand that the .html files need to be changed to .php, but where to go from there, I do not know. I am stuck.

When I load up my mvc in browser that I currently have, it displays the database information ok (screenshot below) https://preview.ibb.co/kdtZNa/Capture.png How would I implement those links into my websites template menu? And when I click those links it takes me to that page and displays database content for that page. I would I implement that into my MVC

Any assistance or help to point me into the right direction would be really appreciated thanks. Or any links that have good information about this.

I am a beginner to php.

If you are just beginning, MVC is not the place to start. You need to learn how to walk before you can run.

Hi I am fairly novice on php, but have done other introductory programming language courses, and have been doing html web development for over 4 years now. I decided to start venturing out on my learning run with php and try adapt the simple model view controller I built as part of a tutorial.

They only had static content in that tutorial, and I have been able to connect my database to the MVC and display its content.

But just a bit stuck on where to go from there to implement my website.
I should mention that I was able to successfully convert this MVC into an MVP, but would like to start with website implementation from the MVC first before I learn how to convert that to MVP.

I guess first thing I could use advice about is, how do I add those links to my menu? So that they call those links up?

I would suggest you actually start with Laravel. It will give you a good education how MVC works. You can check out the Laracasts videos and go step by step.

Thank you, I actually found a great tutorial just recently, it is very informative from what I have read so far. Although it does setup the MVC slightly differently, but it is helping me understand php and MVC more.

Sponsor our Newsletter | Privacy Policy | Terms of Service