Search code examples
modx

ModX Evolution PHP in Resource Content


I am having trouble integrating php into my resources (pages). HTML is not a problem but when I place any php code in the resource it gets ignored. Am I missing something here or does ModX not support PHP?


Solution

  • MODX does indeed support PHP, big-time. But in MODX, PHP goes in "snippets", and the snippets are referenced in resources like this: [[mySnippet]]. Put PHP directly into a resource and it will be ignored.

    More in the documentation: http://rtfm.modx.com/display/Evo1/Adding+Snippets