Prev | Current Page 239 | Next

Emilian Balanescu and Cristian Darie

"Beginning PHP and MySQL E-Commerce: From Novice to Professional, Second Edition"

??? The
bug is documented at http://bugs.php.net/bug.php?id=39858. Consult the book??™s errata page for
solutions to this problem.
How It Works: The Department Componentized Template
Congratulations! If your little list of departments functions as described, you??™ve just made it past the toughest part
of this book. Make sure you understand very well what happens in the code before moving on.
After implementing the data and business tiers, adding the visual part was a fairly easy task. After adding the CSS
styles and creating the blank template file, you created the Smarty template file department.tpl, which contains
the HTML layout for displaying a department??™s data. This template file is loaded in the contents cell, just below the
header, in store_front.tpl:




{include file=$obj->mContentsCell}



The $mContentsCell field of the presentation object is populated in store_front.php, depending on the query
string parameters. At the moment, if the DepartmentId parameter is found in the query string, the page contents
cell is populated with the department.tpl template file you just wrote. Otherwise (such as when you??™re on the
first page), the blank.


Pages:
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251