Skip to content

Instantly share code, notes, and snippets.

@sashabeep
Created February 15, 2023 16:33
Show Gist options
  • Save sashabeep/dead0667d04809c8c81ae618f8ffb0c8 to your computer and use it in GitHub Desktop.
Save sashabeep/dead0667d04809c8c81ae618f8ffb0c8 to your computer and use it in GitHub Desktop.
Evo 2.0 api test
<?php
define('MODX_API_MODE', true);
define('MODX_BASE_PATH', __DIR__."/");
define('MODX_BASE_URL', '/');
define('MODX_SITE_URL', 'http://sitename.tld/');
include_once(MODX_BASE_PATH."index.php");
$modx->db->connect();
if (empty ($modx->config)) {
$modx->getSettings();
}
//test
echo($modx->getConfig('site_name').PHP_EOL);
$menu = $modx->runSnippet('DLMenu',[
'parents' => 0,
'maxDepth' => 2
],0);
echo($menu);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment