Skip to content

Instantly share code, notes, and snippets.

@vgrish
Last active February 7, 2016 10:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vgrish/8189582355782ec13394 to your computer and use it in GitHub Desktop.
Save vgrish/8189582355782ec13394 to your computer and use it in GitHub Desktop.
<?php
echo "<pre>";
$modx->switchContext('web');
$modx->invokeEvent('OnHandleRequest');
if (!$twiggy = $modx->getService('twiggy', 'twiggy', $modx->getOption('twiggy_core_path', null, $modx->getOption('core_path') . 'components/twiggy/') . 'model/twiggy/')) {
return 'Could not load twiggy class!';
}
$tpl = '
{% set aaaa = runSnippet("!pdoResources", {
"parents":1,
"limit":4000,
"tpl": "@INLINE {{ _[\"id\"] }}-{{ _[\"menuindex\"] }}-{{ _[\"createdon\"] }}-{{ _[\"publishedon\"] }}"
}) %}
{{ getInfo() }}';
$output = $twiggy->process($tpl, array(), false);
print_r($output);
@vgrish
Copy link
Author

vgrish commented Feb 5, 2016

totalTime : 1.3793 s
queryTime : 0.0526 s
phpTime : 1.3267 s
queries : 9
source : cache

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment