| Mojolicious documentation | view source | Contained in the Mojolicious distribution. |
Mojo::Path - Path
use Mojo::Path;
my $path = Mojo::Path->new('/foo/bar%3B/baz.html');
shift @{$path->parts};
print "$path";
Mojo::Path is a container for URL paths.
Mojo::Path implements the following attributes.
leading_slashmy $leading_slash = $path->leading_slash; $path = $path->leading_slash(1);
Path has a leading slash.
partsmy $parts = $path->parts; $path = $path->parts(qw/foo bar baz/);
The path parts.
trailing_slashmy $trailing_slash = $path->trailing_slash; $path = $path->trailing_slash(1);
Path has a trailing slash.
Mojo::Path inherits all methods from Mojo::Base and implements the following new ones.
new my $path = Mojo::Path->new;
my $path = Mojo::Path->new('/foo/bar%3B/baz.html');
Construct a new Mojo::Path object.
append$path = $path->append(qw/foo bar/);
Append parts to path.
canonicalize$path = $path->canonicalize;
Canonicalize path.
clonemy $clone = $path->clone;
Clone path.
parse $path = $path->parse('/foo/bar%3B/baz.html');
Parse path.
to_abs_stringmy $string = $path->to_abs_string;
Turn path into absolute string. Note that this method is EXPERIMENTAL and might change without warning!
to_stringmy $string = $path->to_string;
Turn path into a string.
Mojolicious, Mojolicious::Guides, http://mojolicio.us.
| Mojolicious documentation | view source | Contained in the Mojolicious distribution. |