Hi coders,
I have a simple table like this:
CREATE TABLE
omniais
(
id
INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
isodatetime
DATETIME NULL DEFAULT NULL,
nmdb
FLOAT NULL DEFAULT NULL,
f10
FLOAT NULL DEFAULT NULL,
ap
FLOAT NULL DEFAULT NULL,
pc
FLOAT NULL DEFAULT NULL,
bz
FLOAT NULL DEFAULT NULL,
dst
FLOAT NULL DEFAULT NULL,
PRIMARY KEY (id
) USING BTREE
)
I have a simple filter based on form
<?= $this->Form->create(null,['type'=>'get'])?>
and I need to export filtered data to CSV file using the firends of cake extension CsvView. To do so, I added a function
public csv()
into my controller and I wanted to pass current search conditions using URL like this:
If I echo the $full_url, I am see correct url:
Nevertheless, if I click on DOWNLOAD CSV button, CakePHP returns this URL with ‘&’; instead of &:
As a consequence, I can not use getParam in csv() function of the same controller and I am getting back this:
All parameters instead of first one are determined in a wrong way as the have prefix ‘amp;’:
‘?’ => [
‘column_sel’ => ‘nmdb’,
‘amp;bottom_limit’ => ‘166.773’,
‘amp;upper_limit’ => ‘166.774’,
‘amp;date_from’ => ‘2003-03-26’,
‘amp;date_to’ => ‘2024-03-26’,
],
Can anybody please help me how to fix this issue? How to force not replacing ‘&’ with ‘&’?
I know that I could store the parameters into session but I am interested in the correct solution of this problem.
Thanks a lot in advance.