partial.js logo
Latest version
v1.3.1 (RC2)

Builders.UrlBuilder


URL builder is helpful for dynamic creating URL address.


var builders = require('partial.js/builders');
var builder = new builders.UrlBuilder();

Methods


builder.add(name, value)builder.clear()builder.hasValue(keys)builder.read(name)builder.remove(name)builder.toOne(keys, [delimiter])builder.toString()new UrlBuilder()
builder.add(name, value);
return UrlBuilder;

Add a parameter.

builder.clear();
return PageBuilder;

Clear URL parameter collection.

builder.hasValue(keys);
return Boolean;

Check if collection contain value.

builder.read(name);Default: null
return String;

Read value from a parameter.

builder.remove(name);
return PageBuilder;

Remove a parameter.

builder.toOne(keys, [delimiter]);
return String;

Serialize parameters by the keys.

builder.toString();
important
return String;

Serialize parameters. Example: key1=value1&key2=value2

new UrlBuilder();
return UrlBuilder;

Create an instance.