pretty url in custom module
Posted: Sat Apr 19, 2008 1:20 pm
Hi,
Im trying to turn my links in my module into pretty urls, they are working fine in other modules. Ive basically followed the docs found on this site, please tell me if i have done something wrong.
the module is called JobSearch, and im trying to create a friendly link in my action.jobs.php page. I need the link to be directed to my action.job.php page with a jobid parameter.
1. Made a SetParameters function in my JobSearch.module.php file, and created my jobid parameter
2. Used the CreateLink function to generate my pretty url in action.jobs.php
currently the result of this echo is: http://www.url.com.au/websites/cmsmades ... rch/1.html but it doesnt work.
Any help is appreciated, thanks.
Im trying to turn my links in my module into pretty urls, they are working fine in other modules. Ive basically followed the docs found on this site, please tell me if i have done something wrong.
the module is called JobSearch, and im trying to create a friendly link in my action.jobs.php page. I need the link to be directed to my action.job.php page with a jobid parameter.
1. Made a SetParameters function in my JobSearch.module.php file, and created my jobid parameter
Code: Select all
function SetParameters() {
$this->CreateParameter('jobid','','job id', false);
$this->RegisterRoute('/JobSearch\/(?P<jobid>[0-9]+)\/(?P<returnid>[0-9]+)$/',array('action'=>'job'));
}
Code: Select all
echo $this->CreateLink($id, 'job', $returnid, '', array('jobid'=>1), '', true, false, '', false, 'JobSearch/1'.$returnid);
Any help is appreciated, thanks.