0
votes

I have a searchable, sortable table in cakephp. The search and sort criteria are passed as named parameters. Now I would like to add a button which calls a method viewPdf on the very same controller to create a PDF showing the current table content. In fact, I get the correct PDF output just by replacing the action parameter in my url. But how do I get the correct link url for the button with all the current parameters? I could implode all the values and keys of $this->params->named but I am sure there is a much better way to achieve what I want.

Regards

Alex

1

1 Answers

0
votes

You are actually pretty close. You can form such a link using

$url = array('action' => 'pdf') + $this->request->params['named'];
echo $this->Html->link('Title', $url);

Assuming you are using cake2.x (which you always should mention in your question!).