Swat/SwatInputControl.php
public function getForm()
    {
        $form = $this->getFirstAncestor('SwatForm');
        if ($form === null) {
            $path = get_class($this);
            $object = $this->parent;
            while ($object !== null) {
                $path = get_class($object) . '/' . $path;
                $object = $object->parent;
            }
            throw new SwatException(
                "Input controls must reside inside a " .
                    "SwatForm widget. UI-Object path:\n" .
                    $path
            );
        }

        return $form;
    }
public function getForm()
    {
        $form = $this->getFirstAncestor('SwatForm');
        if ($form === null) {
            $path = get_class($this);
            $object = $this->parent;
            while ($object !== null) {
                $path = get_class($object) . '/' . $path;
                $object = $object->parent;
            }
            throw new SwatException(
                "Input controls must reside inside a " .
                    "SwatForm widget. UI-Object path:\n" .
                    $path
            );
        }

        return $form;
    }
public function getForm ( ) { $ form = $ this -> getFirstAncestor ( 'SwatForm' ) ; if ( $ form === null ) { $ path = get_class ( $ this ) ; $ object = $ this -> parent ; while ( $ object !== null ) { $ path = get_class ( $ object ) . '/' . $ path ; $ object = $ object -> parent ; } throw new SwatException ( "Input controls must reside inside a " . "SwatForm widget. UI-Object path:\n" . $ path ) ; } return $ form ; }
Gets the form that this control is contained in

You can also get the parent form with the
{@link SwatUIObject::getFirstAncestor()} method but this method is more
convenient and throws an exception .

@return SwatForm the form this control is in.

@throws SwatException
Gets the form that this control is contained in