I have a while loop to list records in a database table. On each record I have an edit link. I am creating that link with the following code:
$rec->edit = $this->CreateFrontendLink($row['id'], $returnid, 'add_edit', $this->Lang('edit'), array('id'=>$rec->id));
However, when the link is clicked the only variable that is in $params on the destination page is the action parameter which contains a value of "add_edit". It should also contain the "id" parameter that is specified as the 5th parameter of CreateFrontendLink, shouldn't it?
The url does contain the id value however, in the example below it is "2".
http://..........moduleinterface.php?mact=ModuleName,2,add_edit,1&sp_=8dfc6a67
Additionally if I output "$id" it always has a value of "m1_" regardless of what record I choose to edit.
Why isn't the id inside of the $params array? How do I access it?
Thanks,
Jay
CreateFrontendLink & params problem
CreateFrontendLink & params problem
Last edited by kochiro on Mon Jan 11, 2010 11:30 am, edited 1 time in total.
Re: CreateFrontendLink & params problem
what happens if you var_dump the $params array? Is there anything inside it?
Re: CreateFrontendLink & params problem
The first parameter of CreateFrontendLink is the module ID.
You need something more along these lines:
CreateFrontendLink($id,$returnid, 'add_edit', $this->Lang('edit'), array('recordID'=>$row['id']));
You need something more along these lines:
CreateFrontendLink($id,$returnid, 'add_edit', $this->Lang('edit'), array('recordID'=>$row['id']));