how to get $_GET variables in NS 4.0
  • in 3.5 this code worked well
    {{php}}
    $this->assign("page",$_GET['ls-art1']);
    {{/php}}

    but in 4.0 there is new smarty. I tried $template.get.ls-art1 and it returns 0. Probably there is a problem with "-" in variable name.
    Any ideas?
     
    Post edited by Tomasz Rondio at 2012-05-16 08:52:19
  • 2 Comments sorted by
  • solution:
    {{ $page=intval($gimme->url->get_parameter('ls-art1')) }}
    Post edited by Tomasz Rondio at 2012-05-16 09:04:57
  • it's {{ $smarty.get.param }} but it's not working with names containing "-",

    there is a workaround:

    {{ $param = "ls-art1" }} {{ $smarty.get.$param }}

    but it's probably better to rename the variable - underscore works fine.

    Post edited by Petr Jasek at 2012-05-16 09:14:51