Prev | Current Page 177 | Next

Emilian Balanescu and Cristian Darie

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

php?DepartmentId=' . $this->mDepartments[$i]['department_id'];
}
}
?>
7. Modify the index.php file to include a reference to the Catalog business tier class:
// Load the application page template
require_once PRESENTATION_DIR . 'application.php';
// Load the database handler
require_once BUSINESS_DIR . 'database_handler.php';
// Load Business Tier
require_once BUSINESS_DIR . 'catalog.php';
// Load Smarty template file
$application = new Application();
8. Make the following modification in presentation/templates/store_front.tpl to load the newly
created departments_list componentized template. Search for the following code:

Place list of departments here

CHAPTER 4 ?–  CREATING THE PRODUCT CATALOG: PART 1 104
and replace it with this:

{include file="departments_list.tpl"}

9. Examine the result of your work with your favorite browser by loading http://localhost/tshirtshop/
index.php (refer to Figure 4-13). Play a little with the page to see what happens when you click a department
or place the mouse over a link.
?– Note If you don??™t get the expected output, make sure your machine is configured correctly and all PHP
required modules, such as PDO, were loaded successfully. Many errors will be reported in the Apache error
log file (by default, C:/xampp/apache/logs/error.log on Windows or /opt/lampp/logs/error_log on
Linux).


Pages:
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189
Sarah McLachlan Eric Marienthal deweloper warszawa Limp Bizkit Ludacris