Hello,
I’m converting a snippet for Revolution, and playing with all the new features.
Copying the behaviour of another snippets, i wanted default properties to show when i drag & drop a snippet in textarea.
Am i doing something wrong?
Snippet code:
<?php
$cumulus_path = $modx->getOption('core_path').'components/cumulus/';
if (!class_exists('Cumulus')){
$modx->addPackage('cumulus',$cumulus_path.'model/');
$modx->loadClass('cumulus.Cumulus',$cumulus_path.'model/',true,true);
}
$Cumulus = new Cumulus($modx,$scriptProperties);
return $Cumulus->getOutput();
?>
Class code:
<?php
class Cumulus {
function Cumulus(&$modx,$config = array()) {
$this->__construct($modx,$config);
}
function __construct(&$modx,$config = array()) {
$this->modx =& $modx;
$this->config = array_merge(array(
'parent' => "1",
'depth' => 10,
'days' => 0,
'min' => 0,
'landing' => "[[~[[*id]]]]",
'tvTags' => "tags",
'tagDelimiter' => ",",
),$config);
}
}
?>