I tried various ways of converting to an INT with no success. Now I know the problem. My variable, although it outputs "string" when type tested, is actually an array starting with two curly braces and that is what is confusing php. I've got it sorted now. In case this helps any Contao users trying to write php with contao variables.....
Don't do this:
Code:
$myPageVar = '{{page::id}}';//gives you something php doesn't understand
Do this:
Code:
$myPageVar = $this->replaceInsertTags( '{{page::id}}' ); //for a php friendly variable
Bookmarks