Hi coders,
I have a simple table like this:
CREATE TABLE
omniais(
idINT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
isodatetimeDATETIME NULL DEFAULT NULL,
nmdbFLOAT NULL DEFAULT NULL,
f10FLOAT NULL DEFAULT NULL,
apFLOAT NULL DEFAULT NULL,
pcFLOAT NULL DEFAULT NULL,
bzFLOAT NULL DEFAULT NULL,
dstFLOAT 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.




