View.php
public function assign(string $key, $value, bool $global = false)
    {
        // Assign a new view variable (global or locale)
        if ($global === false) {
            $this->vars[$key] = $value;
        } else {
            View::$global_vars[$key] = $value;
        }

        return $this;
    }
public function assign(string $key, $value, bool $global = false)
    {
        // Assign a new view variable (global or locale)
        if ($global === false) {
            $this->vars[$key] = $value;
        } else {
            View::$global_vars[$key] = $value;
        }

        return $this;
    }
Assign a view variable.

$view->assign('msg', 'Some message...');

@param  string  $key    Variable name
@param  mixed   $value  Variable value
@param  bool $global Set variable available in all views
@return View