Search code examples
phptimewidgetmodx

Accessing a template variable without it passing through it's widget


I'm try to ascertain an event time from a date template variable in a modx snippet. However that template variable has a date formatter widget in it which, while nicely formatting the date, doesn't output the time of the event.

I know that modx stores dates in unixtime in it's database, is there an easy way to directly access the unixtime of the event? I'm currently using $modx->getTemplateVarOutput() calls.

Thanks for your help


Solution

  • It turns out if you use $modx->getTemplateVars() instead then that allows access to the underlying unixtime in the 'value' element in each element.