require_once($modx->getOption('demo.core_path',null,$modx->getOption('core_path',null,MODX_CORE_PATH).'components/demo/').'model/demo/demo.class.php');
$demo = new Demo($modx,$scriptProperties);
$demo->initialize();
$demo->configInformation();
<?
/**
* The base class for Demo.
*
* @package demo
*/
class Demo {
/**
* A reference to the modX instance
* @var modX $modx
*/
public $modx;
/**
* A configuration array
* @var array $config
*/
public $config;
function __construct(modX &$modx,array $config = array()) {
$this->modx =& $modx;
$corePath = $this->modx->getOption('demo.core_path',null,MODX_CORE_PATH.'components/demo/');
$assetsPath = $this->modx->getOption('demo.assets_path',null,MODX_ASSETS_PATH.'components/demo/');
//Add extra config values
$this->config = array_merge(array(
'package_name' => 'Demo',
'core_path' => $corePath,
'asset_path' => $assetsPath,
), $config);
$this->modx->addPackage('demo', $this->config['core_path'].'model/');
}
public function initialize()
{
//$this->config = array_merge(array(), $this->config);
}
public function configInformation()
{
$this->modx->log(modX::LOG_LEVEL_ERROR, print_r($this->config ,true));
}
}
This question has been answered by Bruno17. See the first response.
<?php
/**
* The base class for Demo.
*
* @package demo
*/
class Demo {you're using short open tags.
This may be your issue.
http://www.php.net/manual/en/language.basic-syntax.phptags.php
<?php /** * The base class for Demo. * * @package demo */ class Demo {