<![CDATA[ Getresources to php array or json string in a seperate file - My Forums]]> https://forums.modx.com/thread/?thread=97474 <![CDATA[Getresources to php array or json string in a seperate file]]> https://forums.modx.com/thread/97474/getresources-to-php-array-or-json-string-in-a-seperate-file#dis-post-527092 hitesh571985 Jun 17, 2015, 05:55 PM https://forums.modx.com/thread/97474/getresources-to-php-array-or-json-string-in-a-seperate-file#dis-post-527092 <![CDATA[Re: Getresources to php array or json string in a seperate file]]> https://forums.modx.com/thread/97474/getresources-to-php-array-or-json-string-in-a-seperate-file#dis-post-527205 sottwell Jun 20, 2015, 01:31 PM https://forums.modx.com/thread/97474/getresources-to-php-array-or-json-string-in-a-seperate-file#dis-post-527205 <![CDATA[Re: Getresources to php array or json string in a seperate file]]> https://forums.modx.com/thread/97474/getresources-to-php-array-or-json-string-in-a-seperate-file#dis-post-527175

Add a :toFile custom output modifier and you're in business.
]]>
BobRay Jun 19, 2015, 11:06 PM https://forums.modx.com/thread/97474/getresources-to-php-array-or-json-string-in-a-seperate-file#dis-post-527175
<![CDATA[Re: Getresources to php array or json string in a seperate file]]> https://forums.modx.com/thread/97474/getresources-to-php-array-or-json-string-in-a-seperate-file#dis-post-527155
[[!migxLoopCollection?
&classname=`modResource`
&where=`{"parent:IN":[1,2,3],"deleted":"0","published":"1"}`
&toJsonPlaceholder=`myplaceholder`
]]


than you can use that placeholder in your snippet and do what you want with it.]]>
Bruno17 Jun 19, 2015, 01:43 AM https://forums.modx.com/thread/97474/getresources-to-php-array-or-json-string-in-a-seperate-file#dis-post-527155
<![CDATA[Re: Getresources to php array or json string in a seperate file]]> https://forums.modx.com/thread/97474/getresources-to-php-array-or-json-string-in-a-seperate-file#dis-post-527152 sottwell Jun 19, 2015, 01:02 AM https://forums.modx.com/thread/97474/getresources-to-php-array-or-json-string-in-a-seperate-file#dis-post-527152 <![CDATA[Re: Getresources to php array or json string in a seperate file]]> https://forums.modx.com/thread/97474/getresources-to-php-array-or-json-string-in-a-seperate-file#dis-post-527151
If you don't need all the bells and whistles of getResources, you can use a custom snippet.

If you want to post your getResources call and describe the format you want to save, we might be able to come up with some code for you.]]>
BobRay Jun 18, 2015, 11:59 PM https://forums.modx.com/thread/97474/getresources-to-php-array-or-json-string-in-a-seperate-file#dis-post-527151
<![CDATA[Re: Getresources to php array or json string in a seperate file]]> https://forums.modx.com/thread/97474/getresources-to-php-array-or-json-string-in-a-seperate-file#dis-post-527109
http://rtfm.modx.com/revolution/2.x/developing-in-modx/other-development-resources/class-reference/modx/modx.runsnippet
http://stackoverflow.com/questions/8536837/modx-getresources-foreach]]>
sottwell Jun 18, 2015, 03:36 AM https://forums.modx.com/thread/97474/getresources-to-php-array-or-json-string-in-a-seperate-file#dis-post-527109