Prev | Current Page 128 | Next

Rob Allen, Nick Lo, and Steven Brown

"Zend Framework in Action"

We also have two buttons to allow the user to provide feedback. We will
build this feature by starting with the View templates and add HTML and then the JavaScript. We also need
two database fields to hold the two count numbers. I??™m going to use helpful_yes for the first one and
helpful_total for the second.
Licensed to Menshu You
Please post comments or corrections to the Author Online forum at
http://www.manning-sandbox.com/forum.jspa?forumID=329
4.5.1 Adding HTML to the View Templates
The view template that displays the reviews about a place is views/place/index.phtml. We already have a list
containing each review, so we just need to add the count information and the Yes and No buttons. We must
also make sure that we can identify each HTML element that we want to change dynamically by giving it a
unique id. The easiest way to get a unique id is to use a string followed by the review id. The entire code
within the list is shown in listing 4.8.
Listing 4.8: The HTML for the review feedback system


#1
helpful_yes;?>

of
helpful_total; ?>

people found this review helpful.


Pages:
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140

Wczasy nad morzem projektowanie stron poznań najlepsze buchsbaum leczenie alkoholizmu