Sam Boyer @sdboyer
(If anything, more akin to "Controller")
<html> <head> <!-- assorted meta tags go here --> <!-- as do link tags --> <!-- a title tag --> <!-- also, stylesheets and javascript --> </head> <body> <!-- "page top" - not much usually goes here --> <!-- "page" - almost everything is here: blocks and page callback, all together --> <!-- "page bottom" - usually very little, sometimes javascript assets. --> </body> </html>
This is html.tpl.php, or html.html.twig in D8. It is very sparse, but it is the only template that really illustrates our page *model*.
page.tpl.php, which people are more accustomed to seeing, is what populates the 'page' var there in the middle.
The fact that we split them this way points to the first bit of conceptual problem: the "page" is kinda what's within the body tags, but also affects the head.
so, the actual 'page' bit? (bait and switch)
Who gets to put stuff on the page, and why?
The better we answer this question, the saner Drupal sitebuilding is for everyone
hook_page_build() and hook_page_alter() make everything squishy
drupal_add_css/js(), drupal_get_html_head(), etc. blow up encapsulation
<?php class HtmlFragment { protected $content; protected $title; public function getTitle() {} public function getContent() {} }
<?php class HtmlPage { protected $bodyTop; protected $bodyBottom; public function getHtmlAttributes() {} public function getBodyAttributes() {} public function getStatusCode() {} }
Just kinda gotten ready to solve it
...?