GravityView  1.19.4
The best, easiest way to display Gravity Forms entries on your website.
table-body.php
Go to the documentation of this file.
1 <?php
2 /**
3  * Display the entry loop when using a table template
4  *
5  * @package GravityView
6  * @subpackage GravityView/templates
7  *
8  * @global GravityView_View $this
9  */
10 ?>
11  <tbody>
12  <?php
13 
14  do_action('gravityview_table_body_before', $this );
15 
16  if( 0 === $this->getTotalEntries() ) {
17 
18  $directory_table_columns = $this->getFields('directory_table-columns');
19  ?>
20  <tr>
21  <?php do_action('gravityview_table_tr_before', $this ); ?>
22  <td colspan="<?php echo $directory_table_columns ? sizeof( $directory_table_columns ) : ''; ?>" class="gv-no-results">
23  <?php echo gv_no_results(); ?>
24  </td>
25  <?php do_action('gravityview_table_tr_after', $this ); ?>
26  </tr>
27  <?php
28  } else {
29 
30  foreach( $this->getEntries() as $entry ) :
31 
32  $this->setCurrentEntry( $entry );
33 
34  // Add `alt` class to alternate rows
35  $alt = empty( $alt ) ? 'alt' : '';
36 
37  /**
38  * @filter `gravityview_entry_class` Modify the class applied to the entry row
39  * @param string $alt Existing class. Default: if odd row, `alt`, otherwise empty string.
40  * @param array $entry Current entry being displayed
41  * @param GravityView_View $this Current GravityView_View object
42  */
43  $class = apply_filters( 'gravityview_entry_class', $alt, $entry, $this );
44  ?>
45  <tr<?php echo ' class="'.esc_attr( $class ).'"'; ?>>
46  <?php
47  do_action('gravityview_table_cells_before', $this );
48 
49  $this->renderZone( 'columns', array(
50  'markup' => '<td id="{{ field_id }}" class="{{class}}">{{value}}</td>',
51  'hide_empty' => false, // Always show <td>
52  ));
53 
54  do_action('gravityview_table_cells_after', $this );
55  ?>
56  </tr>
57  <?php
59 
60  }
61 
62  do_action('gravityview_table_body_after', $this );
63  ?>
64  </tbody>
$alt
Definition: table-body.php:35
gv_no_results($wpautop=true)
Definition: class-api.php:805
$entry
Definition: notes.php:27
$class
Definition: table-body.php:43
endforeach
Definition: table-body.php:58