I have this code:
<?php $myarray->appends(['action' => $_GET['desc']])->render() ?>
When there is action
argument in the url, then my code works as well. Otherwise it throws this error message:
Undefined index: action (View: /var/www/html/myweb/resources/views/mypage.blade.php)
So I need to do this ->appends(['action' => $_GET['desc']])
dynamically. Something like this:
<?php
if ( isset($_GET['desc']) ) {
$append_param = "->appends(['action' => $_GET['desc']])";
} else {
$append_param = "";
}
$myarray.$append_param->render();
?>
But I'm pretty much sure my code won't work .. I wore code about just for showing you what was my point.
Anyway, can anybody tell me how can I do that in a right way?
All I'm trying to do is: appending action
argument to the pagination-links if it already exists. Otherwise I don't want to append it.