Methods available in the main frontend class

From Site Foundry

Jump to: navigation, search

The following short list of methods are available within the main frontend class and can be called from within your modules' frontend.class.php. For example, to create a URI safe version of a string (and make it consistent with the rest of the application), you would use something like:

$aVar = parent::URISafeString($myString)

Methods

The following list will grow over time to incorporate new features that you may need. If you have any suggestions, please get in touch.

URISafeString

@param string $string
@return string

Description
Generates and returns a safe URI version of your string

isValidEmail

@param string $email
@return boolean

Description
Validates an email address, returns true on success

GetTotalRows

@param string $table
@return integer

Description
Returns the total number of rows in the table that you pass.

NB: This method is depricated, as it's much better to construct modules using SQL_CALC_FOUND_ROWS.

getArrayReplacements

@param array $resource
@param int $id
@return array

Description
Return an array of images that are linked to a particular resource, based on the main table name of the module. Use the strtr php function, which will then run the media tag replacements as in the following example:

$processedString = strtr($content, parent::getArrayReplacements('a_table_name', $anID));

Personal tools