Module erlyweb_util

This module contains a few utility functions useful for ErlyWeb apps.

Copyright © Yariv Sadan 2006-2007

Authors: Yariv Sadan (yarivsblog@gmail.com) [web site: http://yarivsblog.com)].

Description

This module contains a few utility functions useful for ErlyWeb apps.

Function Index

get_cookie/2Get the cookie's value from the arg.
get_url_prefix/1Get the of the arg's appmoddata value up to the first '?' symbol.
indexify/2(Deprecated.) Translate requests such as '/foo/bar' to '/foo/index/bar' for the given list of components.

Function Details

get_cookie/2

get_cookie(Name::string(), A::arg()) -> string()

Equivalent to yaws_api:find_cookie_val(Name, yaws_headers:cookie(A)).

Get the cookie's value from the arg.

get_url_prefix/1

get_url_prefix(A::arg()) -> string()

Get the of the arg's appmoddata value up to the first '?' symbol.

indexify/2

indexify(A::arg(), ComponentNames::[string()]) -> arg()

This function is deprecated: This function is deprecated. Implement catch_all/3 in your controllers instead.

Translate requests such as '/foo/bar' to '/foo/index/bar' for the given list of components. This function is useful for rewriting the Arg in the app controller prior to handling incoming requests.