Practical issues of site architecture
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:
- The controller has to look it up in the
config
file. - The controller has to package it in the
$data
array and pass it to the view. - The view has to extract the single variables
$base
and$css
and look up ...
Get CodeIgniter 1.7 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.