Interactions controller-model

avec attention à l'utilisation des structures de données par les View

Create

Promo

      $user = Model_DB::listAllUsers('last_name');
      $userArray = $user->fetchAll();
      $this->registry->template->userArray = $userArray;

view

              if (isset($userArray)) {
                  foreach ($userArray as $user) {
                      if ($user->role == 2) {
                          echo '<option value="' . $user->id . '">' . $user->last_name . ' ' . $user->first_name . '</option>';

List

Modify

Delete

html forms notes

Radio buttons

Utiliser

''<INPUT type=radio name="taskChoice" value="0" CHECKED>'' planqué (ligne "aucune"?)
''<INPUT type=radio name="taskChoice" value="'.$id$.'" >'' pour chaque ligne
<INPUT type=submit name="chercher" value="chercher">
<INPUT type=

In the following example from htmlhelp.com, only one payment method may be selected by the user since the radio buttons have the same NAME:

<P>Please indicate your method of payment:</P>
<P><LABEL ACCESSKEY=C><INPUT TYPE=radio NAME="payment_method" VALUE="credit card" CHECKED>
   Credit card</LABEL><BR>
<LABEL ACCESSKEY=D><INPUT TYPE=radio NAME="payment_method" VALUE="debit card">
 Debit  card</LABEL><BR>
<LABEL ACCESSKEY=M><INPUT TYPE=radio NAME="payment_method" VALUE="money order">
 Money order</LABEL></P>

<P><LABEL ACCESSKEY=S><INPUT TYPE=checkbox NAME="send_receipt" VALUE="yes" CHECKED>
 Send receipt by e-mail</LABEL></P>

 
projet_dch/model_db.txt · Dernière modification: 2011/05/09 19:32 par suitable