Prev | Current Page 185 | Next

Emilian Balanescu and Cristian Darie

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

'application.php';
require_once PRESENTATION_DIR . 'link.php';
// Load the database handler
require_once BUSINESS_DIR . 'database_handler.php';
7. Load TShirtShop, and make sure it still works as expected. This exercise isn??™t supposed to alter our existing
functionality but to implement an improvement that will prove to be of great help when extending the site in
the following chapters.
How It Works: Using the Link Factory
First of all, make sure the new entry you added to config.php is configured correctly. If you??™re running your web
site on a different port than the default of 80 (say, if you??™re using port 8080), make sure you specify the correct port
in the HTTP_SERVER_PORT constant. Now, let??™s see how the link factory works. The Link presentation object is
used as shown by the modifications you??™ve implemented in store_front.tpl and departments_list.tpl,
and it transforms the relative links received as parameters to absolute links.
?– Note In case you aren??™t using the tshirtshop alias as explained in Chapter 3, you??™ll need to modify the
VIRTUAL_LOCATION constant in config.php to reflect the real location of your web application.
Note that the Build() method doesn??™t add the port if the HTTP_SERVER_PORT constant isn??™t defined or if it contains
the default port 80:
// If HTTP_SERVER_PORT is defined and different than default
if (defined('HTTP_SERVER_PORT') && HTTP_SERVER_PORT != '80')
{
// Append server port
$base .


Pages:
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197
Wzory Dokumentów FIRMA reżyser bizuteria srebrna Kosmetyczka