I got it working, forget about all the trash that the component builders give u, and create your own router.php
heres the solution! for a query:
index.php?option=com_maodeobras&cat=mymaincat&sub=mysubcat&Itemid=123
u gonna have a sef url like /mymaincat/mysubcat.html
function MaodeobrasBuildRoute(&$query)
{
$segments = array();
if(isset($query['cat'])):
$segments[] = $query['cat'];
unset($query['cat']);
endif;
if(isset($query['sub'])):
$segments[] = $query['sub'];
unset($query['sub']);
endif;
return $segments;
}
function MaodeobrasParseRoute($segments)
{
$vars = array();
$vars['cat'] = $segments[0];
$vars['sub'] = $segments[1];
return $vars;
}
And to retrieve these values inside your view file, simple do this echo JRequest::getVar('cat'); or echo JRequest::getVar('sub');
Thats All!!