Actually removes the element.
public _removeElement ( string $short_name ) | ||
$short_name | string | short name |
/** * Removes object from parent and prevents it from rendering * \code * $view = $this->add('View'); * $view -> destroy(); * \endcode. */ public function destroy($recursive = true) { if ($recursive) { foreach ($this->elements as $el) { if ($el instanceof self) { $el->destroy(); } } } /* if (@$this->model && $this->model instanceof AbstractObject) { $this->model->destroy(); unset($this->model); } if (@$this->controller && $this->controller instanceof AbstractObject) { $this->controller->destroy(); unset($this->controller); } */ $this->owner->_removeElement($this->short_name); }