Perforce Chronicle 2012.2/486814
API Documentation

P4Cms_Filter_TitleToId Class Reference

Implements Zend_Filter_Interface to convert titles to ids which are URL and Record friendly. More...

List of all members.

Public Member Functions

 filter ($value)
 Convert a provided title into an acceptable id for use in URLs or Records.

Detailed Description

Implements Zend_Filter_Interface to convert titles to ids which are URL and Record friendly.

Copyright:
2011-2012 Perforce Software. All rights reserved
License:
Please see LICENSE.txt in top-level folder of this distribution.
Version:
2012.2/486814

Member Function Documentation

P4Cms_Filter_TitleToId::filter ( value)

Convert a provided title into an acceptable id for use in URLs or Records.

Parameters:
mixed$valueThe title to be filtered
Returns:
string The id based on the provided title.
    {
        $value = strtolower((string)$value);
        $value = preg_replace('/[^a-z0-9]/', '-', $value);

        return trim($value, '-');
    }

The documentation for this class was generated from the following file: