[TYPO3-dev] typoscript check if get variable is bigger than 0

Franz Koch typo.removeformessage at fx-graefix.de
Tue Dec 2 16:35:23 CET 2008


Hi again,

> I feel quite comfortable using GP in the condition. I am not sure
> that having the same parameter in both GET and POST is good.

that depends on what parameters you need to check. If you're using 
piVars in your extension and provide some input form (maybe a dropdown 
selectbox for filtering something, or a commenting form) you will most 
likely have GET and POST vars within the same extensionKey - which is 
the "main" parameter in that case. If you've got f.e. one GET parameter 
that is necessary to show a form, and submit ANY other piVar with the 
same "main" parameter via POST, every check using t3lib_div::GP for the 
GET-parameter will fail - because t3lib_div::GP will ignore any GET 
parameter if it finds any other POST parameter with the same "main" 
namespace/designator.

So if you've got
GET: tx_myext[showform] = 1
POST: tx_myext[comment] = some text

and resubmit the form to the same URL with the GET var, 
t3lib_div::GP('tx_myext[showform]') (or however the assoc array can be 
addressed with this method) will fail.

You would need to resubmit ANY GET var as POST var in your forms in 
order to get this working. It's of course no problem if you're the 
author of the extension - but if you would like to customize some TER 
extension you would need to XCLASS it in some cases only to get that 
simple check working.
-- 
kind regards,
Franz Koch




More information about the TYPO3-dev mailing list