Prev | Current Page 394 | Next

Emilian Balanescu and Cristian Darie

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


Figure 10-9. The admin_departments componentized template in action
This componentized template generates a list populated with each department??™s information,
two text boxes, and a button used to add a new department to the list.
When you click a department??™s Edit button, the name and the description of that department
become editable, and the Update and Cancel buttons appear in place of the Edit button,
as you saw earlier in Figure 10-3.
Exercise: Implementing the admin_departments Componentized Template
1. Create a new template file named admin_departments.tpl in the presentation/templates folder,
and add the following code to it:
{* admin_departments.tpl *}
{load_presentation_object filename="admin_departments" assign="obj"}
action="{$obj->mLinkToDepartmentsAdmin}">

Edit the departments of TShirtShop:


{if $obj->mErrorMessage}

{$obj->mErrorMessage}

{/if}
CHAPTER 10 ?–  CATALOG ADMINISTRATION: DEPARTMENTS AND CATEGORIES 286
{if $obj->mDepartmentsCount eq 0}

There are no departments in your database!


{else}






{section name=i loop=$obj->mDepartments}
{if $obj->mEditItem == $obj->mDepartments[i].department_id}

Department NameDepartment Description 

value="{$obj->mDepartments[i].


Pages:
382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406
Hotel spa bilety lotnicze Noclegi Władysławowo koszule korporacyjne Apartamenty nad morzem