Ejemplo n.º 1
0
 /**
  * Unset a Template Variable
  *
  * Allows to unset a Template Variable from Controller context,
  * instead of using:
  *
  * <code>
  *   $this -> view -> remove( 'variable' );
  *
  *   // OR
  *
  *   unset( $this -> view -> variable );
  * </code>
  *
  * This method is slightly different of others. While __get() and __isset()
  * work over the HTTP GET Params (a.k.a Dynamic Params) this one works over
  * Template Variables
  *
  * @param string $param
  *   Desired Template Variable
  *
  * @throws Next\Controller\ControllerException
  *   Trying to unset an forbidden Template Variable,
  *   always prefixed with an unserscore.
  *
  * @throws Next\Controller\ControllerException
  *   Trying to unset a nonexistent Template Variable
  */
 public function __unset($param)
 {
     try {
         unset($this->view->{$param});
     } catch (ViewException $e) {
         // Standardizing Exception
         throw ControllerException::removalFailure($e);
     }
 }