Return to Snippet

Revision: 43142
at March 17, 2011 12:08 by hotdiggity


Initial Code
<?php
$path = dirname(__FILE__).'/';

define('MODX_SITE_BASE_URL', '/');
define('MODX_SITE_URL', (!isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) == 'off' ? 'http://' : 'https://').$_SERVER['SERVER_NAME'].MODX_SITE_BASE_URL);
$modx_baseurl = MODX_SITE_BASE_URL;

include_once($path.'modxapi.php'); //last release of Modx API file located in the root

$modx = new MODxAPI();
$modx->connect();
$modx->getSettings();
//$modx->startSession();

// Set the base URL for any MODx snippets
$modx->config['base_url'] = MODX_SITE_BASE_URL;

//Run snippet
$modx->runSnippet('snippetname'); 
?>

Initial URL

                                

Initial Description

                                

Initial Title
Run MODx API in external file

Initial Tags

                                

Initial Language
PHP