SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 139 | Next

James Kennard

"Mastering Joomla! 1.5 Extension and Framework Development"


/**
* Builds route for My Extension.
*
* @access public
* @param array Query associative array
* @return array SEF URI segments
*/
function myextensionBuildRoute(&$query)
{
$segments = array();
if (isset($query['category']))
{
$segments[] = $query['category'];
unset($query['category']);
if (isset($query['item']))
{
$segments[] = $query['item'];
unset($query['item']);
}
}
return $segments;
}
Component Design
[ 102 ]
With this function implemented, JRoute::_() can build SEF URIs for our
component. The next step is to decode SEF URIs. This is an example of the
ParseRoute() function that we might use to decode the URI:
/**
* Decodes SEF URI segments for My Extension.
*
* @access public
* @param array SEF URI segments array
* @return array Query associative array
*/
function myextensionParseRoute($segments)
{
$query = array();
if (isset($segments[0]))
{
$query['category'] = $segments[0];
if (isset($segments[1]))
{
$query['item'] = $segments[1];
}
}
return $query;
}
Note that this is essentially the exact opposite of the BuildRoute()
function.


Pages:
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6