Regarding the MVC pattern, the view layer is supposed to be the functions that 'return' HTML data, or the view layer is actually the HTML data itself?
View classes in MVC-inspired patterns for web (it is extremely hard to implement classical MVC on web, and impossible with only PHP) are responsible for presentation logic. Then create response to requests and juggle multiple templates.
The way how information gets from model layer to the chosen view largely depends on which of MVC-inspired patterns is implemented. If you are using MVP or MVVM, then information is provided by the controller and the view is passive ( but view is not a dumb template). If you are going with Model2 MVC or HMVC patterns, then view is active an requests information from model layer.
When this view has acquired the information , it decides with templates to combine. Or even if templates are even necessary. And then create the response.
The response that each View generated can be HTML, JSON, XML or just plain text. Or, if it's required, sent only a HTTP header (like when doing redirect). This all is part of presentation logic.
View Layer is the functions that return the HTML Data
The borderline of model, controller and view can be shown this way:
/* model models/post.php */
<?php
class Post {
public static all() {
return Array(...);
}
}
?>
/* controller /posts/index.php */
<?php
require "../../models/post.php"
$posts = Post.all();
require "../../views/posts/index.php"
?>
/* view /views/posts/index.php */
<?php foreeach ($posts as $post): ?>
<p><?php echo $post['name']; ?></p>
<?php endforeach; ?>
Ideologically it may be just function but common practice is something like template in template engines. So view layer is html + data insertions
(without logic of how we get and why). Again ideologically it is function too, but not function of programming language of framework, for example.
View is the "template"
Model is the "Data"
Controller is the "connector" and the algorithems places.
View Layer is subjected to what you want to be visible on client as a presentation. In most cases it is HTML, CSS and Javascript you can also use XML and JSON.
In genral,
Controller ask Model to provide Data.
Controller can than make changes to this data as it need.
Controller send data to View to present with help of template/html.