Ejemplo n.º 1
0
 /**
  * Set a Template Variable
  *
  * <p>
  *     Allows to set a Template Variable directly from Controller
  *     context, instead of using Next\View\View::assign() or
  *     Next\View\View::__set() (if implemented)
  * </p>
  *
  * <p>This method is slightly different of others.</p>
  *
  * <p>
  *     While __get() and __isset() work over the HTTP GET Params
  *     (a.k.a Dynamic Params) this one works over Template Variables
  * </p>
  *
  * @param string $param
  *   Template Variable Name
  *
  * @param string $value
  *   Template Variable Value
  *
  * @throws Next\Controller\ControllerException
  *   A Next\View\ViewException was caught due a Template Variable
  *   forbiddenness, because it conflicts with a reserved (or internal)
  *   Template Variable name
  */
 public function __set($param, $value)
 {
     try {
         $this->view->{$param} = $value;
     } catch (ViewException $e) {
         // Standardizing Exception
         throw ControllerException::assignmentFailure($e);
     }
 }