Hello all,
Sorry if it was discussed before, but i couldnt find any topics related to this.
Is there any way to include a snippet in an external php file residing on the same domain?
Thanks,
Aleks
MODx Revo 2.0.6-pl (Traditional) | Apache 2.2.3 | PHP 5.2.14 | MySQL 5.0.77 | MAC OS 10.6.5 | FF 3.6/Chrome 9.0.5
create a snippet and include the file
actually i need the opposite
MODx Revo 2.0.6-pl (Traditional) | Apache 2.2.3 | PHP 5.2.14 | MySQL 5.0.77 | MAC OS 10.6.5 | FF 3.6/Chrome 9.0.5
I might be wrong...
transfer your snippet to a file /assets/snippets/mysnippet/mysnippet.php
In modx replace the code from you snippet with include(...mysnippet/mysnippet.php...);
In the external file include the same file.
Or
Connect to the modx table containing the snippets and read the code from there.
Hi,
you need to include the modx api if you want to run the snippet outside MODx.
there are some sample code in the forum.
:-)