_removeElement() public method

Actually removes the element.
public _removeElement ( string $short_name )
$short_name string short name
Esempio n. 1
0
 /**
  * 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);
 }