Wait a moment, you generated the CSS stylesheet address dynamically in your header_view
:
<link rel="stylesheet" type="text/css" href="<?php echo "$base/$css";?>">
This means that the controller had to produce this data, which is only relevant to how the information is displayed. But we've just said the controller shouldn't know or care about that. Isn't that going right in the face of the "loose coupling" principle, we just set? What's more, generating this information dynamically requires several operations:
1. The controller has to look it up in the
config
file.2. The controller has to package it in the
$data
array and pass it to the view.3. The view has to extract the single variables
$base
and$css
and look up their values.
Seems like a roundabout way of doing things. Why not just embed the data statically in the view?
<link rel="stylesheet" type="text/css" href="http://www.mysite.com/mystylesheet.css";">
The advantage of building...