Creates and returns a var javascript object

@param string $name
@param mixed $value
@param bool $is_string

@return JavascriptObject
778580
public function &variable($name, $value, $defer=false, $is_string = false)
    {
        if ($is_string == true) {
            $value = '"' . $value . '"';
        }

        $script = new JavascriptObject();

        $script->setType('var');
        $script->setScript([
            $name,
            $value
        ]);
        $script->setDefer($defer);

        $this->add($script);

        return $script;
    }
518074
public function addVarAttr($name, $value)
    {
        if (!in_array($name, $this->varAttr)) {
            $this->varAttr[$name] = $value;
        }
        return $this;
    }
1143349
public static function stringify($value)
    {
        if (is_string($value)) {
            return $value;
        }
        if ($value === null || is_bool($value)) {
            return var_export($value, true);
        }

        if (is_array($value) || (is_object($value) && !method_exists($value, '__toString'))) {
            return json_encode($value, JSON_ERROR_NONE | JSON_UNESCAPED_SLASHES);
        }
        return (string)$value;
    }
351637
public static function setVar($name,$value){
		self::init();
		self::$variables[$name]=$value;
		return true;
		}
538224
static public function url($name, $value=null, $settings=[])
    {
        $settings['media_type'] = 'url';
        $settings['with_input'] = isset($settings['with_input']) ? $settings['with_input'] : 'text';
        return static::select($name, $value, $settings);
    }
1187912
public function make(string $name = null, string $value = null): \BearFramework\App\Request\QueryItem
    {
        if ($this->newQueryItemCache === null) {
            $this->newQueryItemCache = new \BearFramework\App\Request\QueryItem();
        }
        $object = clone($this->newQueryItemCache);
        if ($name !== null) {
            $object->name = $name;
        }
        if ($value !== null) {
            $object->value = $value;
        }
        return $object;
    }
523443
public function make(string $name = null, string $value = null): \BearFramework\App\Response\Cookie
    {
        if ($this->newCookieCache === null) {
            $this->newCookieCache = new \BearFramework\App\Response\Cookie();
        }
        $object = clone($this->newCookieCache);
        if ($name !== null) {
            $object->name = $name;
        }
        if ($value !== null) {
            $object->value = $value;
        }
        return $object;
    }
483660
public String getJavaScriptHtmlCookieString(String name, String value) {
        return getJavaScriptHtmlCookieString(name, value, null);
    }
953814
public function map(string $key, bool $is_key_string, string $value, bool $is_value_string)
    {
        $this->_map[$key] = [
            'value' => $value,
            'is_key_string' => $is_key_string,
            'is_value_string' => $is_value_string,
        ];

        return $this;
    }
104859
public VarValueDefBuilder hasIf( String name, Optional<Object> value)
    {
    return hasIf( name, value.orElse( null));
    }
713264
public static function phpArray($var, $varname = 'varName', $isReturn = false)
    {
        if (!self::isDebug()) {
            return false;
        }

        $output = JBDump_array2php::toString($var, $varname);
        if ($isReturn) {
            return $output;
        }

        $_this = self::i();
        $_this->_dumpRenderHtml($output, $varname, $params);

        return $_this;
    }
922826
public static function param($value, $as_name = '', $is_throw = true) {
        $validate = new static();
        $validate->value = $value;
        $validate->as_name = $as_name;
        $validate->is_throw = $is_throw;
        return $validate;
    }
163969
public function bind_value( string $name, $value, $data_type = false ) {
		$this->values_to_bind[ $name ] = array(
			'value'     => $value,
			'data_type' => $data_type,
		);
	}
1247433
public function attribute(string $name, string $value = null) : object
    {
        $this->attributes[$name] = $value;
        return $this;
    }
400630
public static function is(string $name, $value): bool
    {
        if (!static::has($name)) {
            return false;
        }

        return static::get($name) == $value;
    }
496976
public static function set($key, $value, $is_array = false)
    {
        if ($is_array)
        {
            $_SESSION[$key][] = $value;
        }
        else
        {
            $_SESSION[$key] = $value;
        }
    }
400418
private function as_string( $value ) {

		if ( is_object( $value ) && method_exists( $value, '__toString' ) ) {
			$value = (string) $value;
		}

		if ( is_string( $value ) ) {
			return $value;
		} elseif ( is_null( $value ) ) {
			return 'NULL';
		} elseif ( is_bool( $value ) ) {
			return $value ? '(boolean) TRUE' : '(boolean) FALSE';
		}

		if ( is_object( $value ) ) {
			$value = get_class( $value );
			$type  = '(object) ';
		} elseif ( is_array( $value ) ) {
			$type  = '';
			$value = var_export( $value, TRUE );
		}

		isset( $type ) or $type = '(' . gettype( $value ) . ') ';

		return $type . (string) $value;
	}