Hey
I’d like to apply an output filter to the return value of a snippet:
With
[[!getReqParam? &name=`value`:urlencode]]
I’m getting an empty output but
[[!getReqParam? &name=`value`]]
works fine.
Am I using the wrong syntax?
Add-On to easily manage your multilingual sites:
Babel
Hello
Did you try
[[!getReqParam? &name=`value:urlencode`]]
Cheers
Hmm, I don’t think this make sense because getReqParam returns the value of
See
http://modxcms.com/extras/package/?package=665 for details.
I don’t want to apply the filter on the name parameter. I want to apply it on the value which is return by
[[!getReqParam? &name=`value`]]
Add-On to easily manage your multilingual sites:
Babel
Which version of MODx? Your original version should work in Revolution. In Evolution, you’d have to install the PHX plugin.
Hey Bob!
I’m using Revolution (2.0.3). But
[[!getReqParam? &name=`value`:urlencode]]
returns nothing whereas $_GET[’value’] contains ’test’. When using
[[!getReqParam? &name=`value`]]
’test’ is returned.
getReqParam is a snippet provided by this package:
http://modxcms.com/extras/package/?package=665
Add-On to easily manage your multilingual sites:
Babel
It’s hard to know what’s going wrong. All the :urlencode output modifier does it replace $output with urlencode($output). Maybe there’s something odd about what is returned from getReqParam. I don’t have that package installed.
I figured out a solution to a problem like this:
instead of
[[!getReqParam? &name=`value`]]
try
[[!getReqParam:replace=`A==B`? &name=`value`]]
someone
MODx 2.0.6
PHP 5.3.3
MySQL 5.1.50
"Someone" is correct. Output modifiers must go after the snippet name and before the questions mark that precedes the snippet arguments.
Revo 2.0.8-pl