-1

Does anyone know how to get parameter from url like this:

mywebsite.com/index.php?route=account/register&a=1&b=2

i want to get param: a, b in .twig files opencart 3.x

GabrieleMartini
  • 1,665
  • 2
  • 19
  • 26
wasimw
  • 17
  • 4

1 Answers1

0

Why you need it get in twig? You can get it in corresponding controller file:

if (isset($this->request->get['a'])) {
            $a = $this->request->get['a'];
} else {
$a = '';
}
if (isset($this->request->get['b'])) {
            $b = $this->request->get['b'];
} else {
$b = '';
}

and call in twig...

{{ a }} {{ b }} 
K. B.
  • 1,388
  • 2
  • 13
  • 25
  • how to send value from url param like this: examplete > ndex.php?route=account/register&test=123 tell me how i get this "test" param in register controller – wasimw Jan 20 '19 at 19:18
  • `if (isset($this->request->get['test'])) { $test = $this->request->get['test']; } else { $test = ''; }` – K. B. Jan 20 '19 at 20:47