Set a view variable

@param string $variable
@param mixed $value
@return \JiNexus\Mvc\View\ViewInterface
352424
public function set($variable, $value = null)
    {
        $this->variables[$variable] = array(
            'safe' => $this->htmlEncode($value),
            'unsafe' => $value
        );

        return $this;
    }
976275
public function setVar($name, $value)
	{
		$this->vars[$name] = $value;

		$this->query = null;

		return $this;
	}
770977
public function setIsCurrentValue($var)
    {
        $wrappedVar = is_null($var) ? null : new \Google\Protobuf\BoolValue(['value' => $var]);
        return $this->setIsCurrent($wrappedVar);
    }
1113892
public function setVariable(string $name, $value = null): self
    {
        $this->variables[$name] = $value;

        return $this;
    }
176587
private function _setView()
	{
		if (preg_match('/^[a-z0-9_-]+$/', $this->_requestVars[1])) {
			$this->_view = $this->_requestVars[1];
        } else {
        	$this->_view = $this->_requestVars[1] = self::DEFAULT_VIEW;
        }

        return $this;
	}
1239606
public function setEphemeral($name, $value)
    {
        $ephemeral                        = $this->get(self::EPHEMERAL);
        $ephemeral[$name][self::ACTIVE]   = true;
        $ephemeral[$name][self::VARIABLE] = $value;
        $this->set(self::EPHEMERAL, $ephemeral);

        return $this;
    }
1312172
private function getViewProvider($value): ViewProviderInterface
    {
        foreach ($this->viewProviders as $viewProvider) {
            if ($viewProvider->supports($value)) {
                return $viewProvider;
            }
        }

        throw ViewProviderException::noViewProvider(get_class($value));
    }
539194
public function assign(string $name, $value): ViewFactory
	{
		$this->globalVariables[$name] = $value;

		return $this;
	}
1255782
public function layout($name = null, $variable = 'content')
    {
        $this->layout = array(
            'name' => $name ?: $this->defaultLayout,
            'variable' => $variable
        );
        return $this;
    }
1142157
final public static function with (array $variables) : View
	{
		foreach ($variables as $variableName => $variableValue) 
			static::$passedVariables[$variableName] = $variableValue;
		return new View;
	}
760857
public function setVar($name, $value)
    {
        $context = $this->_context;

        $context->vars[$name] = $value;

        return $this;
    }
783954
public function viewData($key=null, $value=null)
    {
        $view = $this->getView();
        if (!$key) {
            return $view->getData();
        } elseif (is_null($value) && is_string($key)) {
            $viewData = $view->getData();
            return isset($viewData[$key]) ? $viewData[$key] : null;
        } else {
            $view->setData($key, $value);
            return $this;
        }
    }
437017
public function setToView($var, $val)
    {
        $args = func_get_args();
        array_shift($args);
        $this->viewFallback($var, $args, 'set');
        return $this;
    }
436438
public function setGlobalVariable($variable = NULL, $value = NULL)
	{
		try {

			$result = FALSE;

			if (is_null($variable))
				throw new Exception("Global variable name not provided or is null", 503);

			if (is_null($value))
				throw new Exception("Global variable value not provided or is null", 503);

			$uri = "/asterisk/variable";
			$postData = array("variable" => $variable, "value" => $value);

			$this->ariEndpointOptions['json'] = $postData;
			$result = json_decode($this->ariEndpointClient->post($this->ariEndpointURL . $uri, $this->ariEndpointOptions)->getBody()->getContents());

			return $result;

		} catch (\GuzzleHttp\Exception\RequestException $e) {
			$this->phpariObject->lasterror = $e->getMessage();
			$this->phpariObject->lasttrace = $e->getTraceAsString();
			return (int)$e->getCode();
		} catch (\GuzzleHttp\Exception\ClientException $e) {
			$this->phpariObject->lasterror = $e->getMessage();
			$this->phpariObject->lasttrace = $e->getTraceAsString();
			return (int)$e->getCode();
		} catch (\GuzzleHttp\Exception\ServerException $e) {
			$this->phpariObject->lasterror = $e->getMessage();
			$this->phpariObject->lasttrace = $e->getTraceAsString();
			return (int)$e->getCode();
		} catch (Exception $e) {
			$this->phpariObject->lasterror = $e->getMessage();
			$this->phpariObject->lasttrace = $e->getTraceAsString();

			return FALSE;
		}
	}
172320
public function set($variable, $value = null)
    {
        if (is_array($variable)) {
            $this->userData = array_merge($this->userData, $variable);
        } else if (is_object($variable)) {
            $this->userData = array_merge($this->userData, (array)$variable);
        } else {
            if ($value === null) {
                unset($this->userData[$variable]);
            } else {
                $this->userData[$variable] = $value;
            }
        }
    }
1065175
protected function buildView(
        $value,
        string $context = ViewInterface::CONTEXT_DEFAULT,
        array $parameters = [],
        ?Response $response = null
    ): ViewInterface {
        /** @var \Netgen\BlockManager\View\ViewBuilderInterface $viewBuilder */
        $viewBuilder = $this->get('netgen_block_manager.view.view_builder');
        $view = $viewBuilder->buildView($value, $context, $parameters);

        $view->setResponse($response instanceof Response ? $response : new Response());

        return $view;
    }
363002
public function setVariable($variable, $value)
    {
        return $this->client->channels()->setVariable($this->id, $variable, $value);
    }