Swat/SwatTableView.php
protected function displayBody()
    {
        $count = 0;

        // this uses read-ahead iteration

        $this->model->rewind();
        $row = $this->model->valid() ? $this->model->current() : null;

        $this->model->next();
        $next_row = $this->model->valid() ? $this->model->current() : null;

        if (count($this->model) > 0) {
            echo '<tbody>';

            while ($row !== null) {
                $count++;

                $this->displayRow($row, $next_row, $count);

                $row = $next_row;
                $this->model->next();
                $next_row = $this->model->valid()
                    ? $this->model->current()
                    : null;
            }

            echo '</tbody>';
        } else {
            // to validate in the case where the form has a tfoot but no rows
            echo '<tbody class="swat-hidden"><tr><td></td></tr></tbody>';
        }
    }
protected function displayBody()
    {
        $count = 0;

        // this uses read-ahead iteration

        $this->model->rewind();
        $row = $this->model->valid() ? $this->model->current() : null;

        $this->model->next();
        $next_row = $this->model->valid() ? $this->model->current() : null;

        if (count($this->model) > 0) {
            echo '<tbody>';

            while ($row !== null) {
                $count++;

                $this->displayRow($row, $next_row, $count);

                $row = $next_row;
                $this->model->next();
                $next_row = $this->model->valid()
                    ? $this->model->current()
                    : null;
            }

            echo '</tbody>';
        } else {
            // to validate in the case where the form has a tfoot but no rows
            echo '<tbody class="swat-hidden"><tr><td></td></tr></tbody>';
        }
    }
protected function displayBody ( ) { $ count = 0 ; // this uses read-ahead iteration $ this -> model -> rewind ( ) ; $ row = $ this -> model -> valid ( ) ? $ this -> model -> current ( ) : null ; $ this -> model -> next ( ) ; $ next_row = $ this -> model -> valid ( ) ? $ this -> model -> current ( ) : null ; if ( count ( $ this -> model ) > 0 ) { echo '<tbody>' ; while ( $ row !== null ) { $ count ++ ; $ this -> displayRow ( $ row , $ next_row , $ count ) ; $ row = $ next_row ; $ this -> model -> next ( ) ; $ next_row = $ this -> model -> valid ( ) ? $ this -> model -> current ( ) : null ; } echo '</tbody>' ; } else { // to validate in the case where the form has a tfoot but no rows echo '<tbody class="swat-hidden"><tr><td></td></tr></tbody>' ; } }
Displays the contents of this view

The contents reflect the data stored in the model of this table-view.
Things like row highlighting are done here.

Table rows are displayed inside a <tbody> XHTML tag.
Displays the contents of this view