Prev | Current Page 104 | Next

Emilian Balanescu and Cristian Darie

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

This makes things
easier when repeatedly reviewing your work in progress.
Figure 3-9. Running TShirtShop
CHAPTER 3 ?–  STARTING THE TSHIRTSHOP PROJECT 47
How It Works: The First Page of TShirtShop
The main web page contains three major sections. There are two table cells that you??™ll fill with componentized
templates??”one for the list of departments and one for the page contents??”in the following chapters.
Notice the departments list on the left side: the header at the top, and the contents cell filled with information
regarding the first page. As previously mentioned, this contents cell is the only one that changes while browsing
the site; the other two cells will look exactly the same no matter what page is visited. This implementation eases
your life as a programmer and keeps a consistent look and feel for the web site.
Before you move on, it??™s important to understand how the Smarty template works. Everything starts from
index.php, so you need to take a close look at it. Here??™s the code again:
// Include utility files
require_once 'include/config.php';
// Load the application page template
require_once PRESENTATION_DIR . 'application.php';
// Load Smarty template file
$application = new Application();
// Display the page
$application->display('store_front.tpl');
?>
At this moment, this file has very simple functionality.


Pages:
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116