Linked Questions
38 questions linked to/from Understanding MVC Views in PHP
2 votes
1 answer
662 views
What logic should contain the View of a MVC Design? [duplicate]
I've been having this discussion for a while already and I would like to know the broad opinion and reasons for the people in here. The context This question is about the theoretically correct ...
581 votes
5 answers
205k views
How should a model be structured in MVC? [closed]
I am just getting a grasp on the MVC framework and I often wonder how much code should go in the model. I tend to have a data access class that has methods like this: public function CheckUsername($...
6 votes
5 answers
10k views
Where do I put a database query in MVC? [closed]
The last few days, I have extensively read books and web pages about OOP and MVC in PHP, so that I can become a better programmer. I've come upon a little problem in my understanding of MVC: Where do ...
6 votes
2 answers
7k views
How to load classes based on pretty URLs in MVC-like page?
I would like to ask for some tips, on how solve this problem. I'm trying to build my own MVC website. I learned the basics of the URL. http://example.com/blog/cosplay/cosplayer-expo-today blog -> the ...
14 votes
5 answers
4k views
Why split the View in MVC into a view class and a template
I'm relatively new to design patterns but I feel that I've got a good understanding of the MVC pattern and the advantages that this separation of code brings. However, both times I've seen the MVC ...
4 votes
3 answers
6k views
Getting familiar with MVC - how do I work with session logic, additional classes and background logic
While coding PHP, I decided to move from spaghetti code and try to implement MVC. To implement the MVC framework, I vent to this article Article gave a good start and I managed to create my site, and ...
9 votes
1 answer
4k views
Why does the model directly update the view in the MVC pattern?
I've been learning how to build web applications with Laravel and Vue.js and I understand the part where the user uses the view in order to send requests to the controller which then manipulates the ...
1 vote
3 answers
4k views
How to use links in php mvc?
First problem: Main url: site-test 1. I clicked on the link <a href="tasks/">tasks</a> -> url: site-test/tasks 2. i click next link <a href="tasks/page/2">next page</a> (...
-5 votes
1 answer
4k views
PHP mvc how to do file uploading
somebody can help me to make file uploading in form with another data like name email etc... https://github.com/psytonik/School-Project-PHP/tree/master/school_project this is project
2 votes
1 answer
2k views
Using output buffering as a template-engine
So I'm writing my MVC and need to display my views. It's pretty simple at the moment, just wrapped in a function inside my main controller. ob_start(); require_once('views/' . $fileName . '.php'); $...
1 vote
4 answers
931 views
PHP MVC - handling views
I've found a framework that handles the views in a different way than just plain html. To be honest, I've no idea how are the big frameworks handling this issue because I've mostly worked with some ...
1 vote
2 answers
1k views
Foreach loop inside laravel controller
I have recusrive function that build tree form my categories list i finished it and it working fine, but i have 2 approach to put it inside helper function and call it in blade, or to create class and ...
-1 votes
1 answer
1k views
How to separate database from model and extending model over multiple tables
I currently use a home-spun ORM approach to models, ie, an object's properties map to the fields of a table. This seems to be a very workable and intuitive way to work with simple websites. However......
0 votes
1 answer
1k views
Bootstrap, MVC, Ajax, Smarty Php
Okay, I'm learning all about MVC, Bootstrap, Ajax and Smarty and I understand the basic principles of MVC. I am having one major issue however and I just cannot wrap my head around it, no matter how ...
0 votes
1 answer
845 views
How to achieve an MVC view-like pattern without a framework
It's really convenient how MVC patterns allow you to define view a and then load variables into it via the controller. For the sake of argument let us take CodeIgniter as an example: Controller: ...