Swat/SwatContainer.php
public function remove(SwatWidget $widget)
    {
        foreach ($this->children as $key => $child_widget) {
            if ($child_widget === $widget) {
                // use array_splice here instead of unset in order to re-index
                // the array keys
                array_splice($this->children, $key, 1);
                $widget->parent = null;

                if ($widget->id !== null) {
                    unset($this->children_by_id[$widget->id]);
                }

                return $widget;
            }
        }
        return null;
    }
public function remove(SwatWidget $widget)
    {
        foreach ($this->children as $key => $child_widget) {
            if ($child_widget === $widget) {
                // use array_splice here instead of unset in order to re-index
                // the array keys
                array_splice($this->children, $key, 1);
                $widget->parent = null;

                if ($widget->id !== null) {
                    unset($this->children_by_id[$widget->id]);
                }

                return $widget;
            }
        }
        return null;
    }
public function remove ( SwatWidget $ widget ) { foreach ( $ this -> children as $ key => $ child_widget ) { if ( $ child_widget === $ widget ) { // use array_splice here instead of unset in order to re-index // the array keys array_splice ( $ this -> children , $ key , 1 ) ; $ widget -> parent = null ; if ( $ widget -> id !== null ) { unset ( $ this -> children_by_id [ $ widget -> id ] ) ; } return $ widget ; } } return null ; }
Removes a widget

Removes a child widget from this container. The parent of the widget is
set to null.

@param SwatWidget $widget a reference to the widget to remove.

@return SwatWidget a reference to the removed widget, or null if the
widget is not found.
Removes a widget