ZenMagick 0.9.10


zenmagick.store.shared.mvc.tools\ZMToolboxNet
mvc\toolbox\ZMToolboxNet.php at line 30

Class ZMToolboxNet

ZMObject
└─ZMToolboxTool
└─ZMToolboxNet

public class ZMToolboxNet
extends ZMToolboxTool

Networking/URL related functions.

Author:
DerManoMann

Fields inherited from org.zenmagick.mvc.toolbox\ZMToolboxTool
request_, toolbox_
Fields inherited from org.zenmagick.core\ZMObject
properties_
Method Summary
string

ajax(string controller, string method, string params)

Create an Ajax URL for the given controller and method.

static string

decode(string url)

Decode a HTML encoded URL.

static string

encode(string url)

Encode a given URL to valid HTML.

string

ezPage(ZMEZPage page)

Build an ez-page URL.

string

image(string src)

Create an absolute image path/URL for the given image.

string

product(int productId, int categoryId)

Convenience function to build a product URL.

string

resultListBack(ZMResultList resultList, boolean secure, array keep)

Build a result list URL pointing to the previous page.

string

resultListNext(ZMResultList resultList, boolean secure, array keep)

Build a URL pointing to the next page.

string

rssFeed(string channel, string key)

Build a RSS feed URL.

string

staticPage(string name)

Create a static page URL for the given static page name.

string

trackLink(string action, string id)

Create an redirecting URL for the given action and id that is trackable.

string

url(string requestId, string params, boolean secure)

Create a URL.

Methods inherited from org.zenmagick.mvc.toolbox\ZMToolboxTool
__construct, getRequest, getToolbox, setRequest, setToolbox
Methods inherited from org.zenmagick.core\ZMObject
__construct, attachMethod, get, getAttachedMethods, getProperties, getPropertyNames, set, singleton

Method Detail

mvc\toolbox\ZMToolboxNet.php at line 168

ajax

public string ajax(string controller, string method, string params)

Create an Ajax URL for the given controller and method.

NOTE: Ampersand are not encoded in this function.

Parameters:
controller - The controller name without the leading ajax_.
method - The name of the method to call.
params - Query string style parameter; if null add all current parameter
Returns:
A complete Ajax URL.

mvc\toolbox\ZMToolboxNet.php at line 62

decode

public static string decode(string url)

Decode a HTML encoded URL.

Parameters:
url - The url to decode.
Returns:
The decoded URL.

mvc\toolbox\ZMToolboxNet.php at line 52

encode

public static string encode(string url)

Encode a given URL to valid HTML.

Parameters:
url - The url to encode.
Returns:
The URL encoded in valid HTM.

mvc\toolbox\ZMToolboxNet.php at line 103

ezPage

public string ezPage(ZMEZPage page)

Build an ez-page URL.

Parameters:
page - A ZMEZPage instance.
Returns:
A complete URL for the given ez-page.

mvc\toolbox\ZMToolboxNet.php at line 138

image

public string image(string src)

Create an absolute image path/URL for the given image.

Parameters:
src - The relative image name (relative to zen-cart's image folder).
Returns:
The image URI.

mvc\toolbox\ZMToolboxNet.php at line 76

product

public string product(int productId, int categoryId)

Convenience function to build a product URL.

Please note that in ZenMagick all product URLs use the same view name. The actual view name gets resolved only when the href is used.

Parameters:
productId - The product id.
categoryId - Optional category id.
Returns:
A complete product URL.

mvc\toolbox\ZMToolboxNet.php at line 207

resultListBack

public string resultListBack(ZMResultList resultList, boolean secure, array keep)

Build a result list URL pointing to the previous page.

Parameters:
resultList - The current result list.
secure - If true, the URI will be secure; default is null to use the current request state.
keep - Optional list of parameters to keep.
Returns:
A URL pointing to the previous page or null.

mvc\toolbox\ZMToolboxNet.php at line 232

resultListNext

public string resultListNext(ZMResultList resultList, boolean secure, array keep)

Build a URL pointing to the next page.

Parameters:
resultList - The current result list.
secure - If true, the URI will be secure; default is null to use the current request state.
keep - Optional list of parameters to keep.
Returns:
A URL pointing to the next page or null.

mvc\toolbox\ZMToolboxNet.php at line 188

rssFeed

public string rssFeed(string channel, string key)

Build a RSS feed URL.

Parameters:
channel - The channel.
key - Optional key; for example, 'new' for the product channel.
Returns:
A complete URL.

mvc\toolbox\ZMToolboxNet.php at line 93

staticPage

public string staticPage(string name)

Create a static page URL for the given static page name.

Parameters:
name - The static page name.
Returns:
A complete URL for the given static page.

mvc\toolbox\ZMToolboxNet.php at line 154

trackLink

public string trackLink(string action, string id)

Create an redirecting URL for the given action and id that is trackable.

All messages created up to this point during request handling will be saved and restored with the next request handling cycle.

Parameters:
action - The redirect action.
id - The redirect id.
Returns:
A full URL.

mvc\toolbox\ZMToolboxNet.php at line 42

url

public string url(string requestId, string params, boolean secure)

Create a URL.

Convenience/compatibility method calling url() on ZMRequest.

Parameters:
requestId - The request id.
params - Query string style parameter; if null add all current parameter
secure - Flag indicating whether to create a secure or non secure URL; default is false.
Returns:
A full URL.

ZenMagick 0.9.10