Swat/SwatTableViewInputRow.php
public function display()
    {
        if (!$this->isVisible()) {
            return;
        }

        parent::display();

        if (count($this->replicators) < $this->number) {
            $diff = $this->number - count($this->replicators);
            $next_replicator =
                count($this->replicators) === 0
                    ? 0
                    : end($this->replicators) + 1;

            for ($i = $next_replicator; $i < $diff + $next_replicator; $i++) {
                $this->replicators[] = $i;
            }
        }

        // add replicator ids to the form as a hidden field
        $this->getForm()->addHiddenField(
            $this->getId() . '_replicators',
            implode(',', $this->replicators)
        );

        $this->displayInputRows();
        $this->displayEnterAnotherRow();
    }
public function display()
    {
        if (!$this->isVisible()) {
            return;
        }

        parent::display();

        if (count($this->replicators) < $this->number) {
            $diff = $this->number - count($this->replicators);
            $next_replicator =
                count($this->replicators) === 0
                    ? 0
                    : end($this->replicators) + 1;

            for ($i = $next_replicator; $i < $diff + $next_replicator; $i++) {
                $this->replicators[] = $i;
            }
        }

        // add replicator ids to the form as a hidden field
        $this->getForm()->addHiddenField(
            $this->getId() . '_replicators',
            implode(',', $this->replicators)
        );

        $this->displayInputRows();
        $this->displayEnterAnotherRow();
    }
public function display ( ) { if ( ! $ this -> isVisible ( ) ) { return ; } parent :: display ( ) ; if ( count ( $ this -> replicators ) < $ this -> number ) { $ diff = $ this -> number - count ( $ this -> replicators ) ; $ next_replicator = count ( $ this -> replicators ) === 0 ? 0 : end ( $ this -> replicators ) + 1 ; for ( $ i = $ next_replicator ; $ i < $ diff + $ next_replicator ; $ i ++ ) { $ this -> replicators [ ] = $ i ; } } // add replicator ids to the form as a hidden field $ this -> getForm ( ) -> addHiddenField ( $ this -> getId ( ) . '_replicators' , implode ( ',' , $ this -> replicators ) ) ; $ this -> displayInputRows ( ) ; $ this -> displayEnterAnotherRow ( ) ; }
Displays this row

Uses widget cloning inside {@link SwatInputCell} to display rows and
also displays the 'enter-another-row' button. The number of rows
displayed is set either through {SwatTableViewInputRow::$number} or
by the number of rows the user submitted. When a user submits a
different number of rows than {SwatTableViewInputRow::$number} it
the user submitted number takes precedence.
Displays this row