Это мой фрагмент:
Код: Выделить всё
$defaultDoodlesCorePath = $modx->getOption('core_path').'components/musiclabel/';
$doodlesCorePath = $modx->getOption('musiclabel.core_path',null,$defaultDoodlesCorePath);
$dood = $modx->getService('musiclabel','MusicLabel',$doodlesCorePath.'model'.DIRECTORY_SEPARATOR.'musiclabel'.DIRECTORY_SEPARATOR,$scriptProperties);
$c = $modx->newQuery('MusicLabel');
$c->prepare();
$leadersql = "SELECT * FROM `modx_musiclabels` WHERE 1";
$q= $modx->query($leadersql);
while ($row = $q->fetch(PDO::FETCH_ASSOC)) {
print_r($row);
}
$output = $doodlesCorePath.'model'.DIRECTORY_SEPARATOR.'musiclabel'.DIRECTORY_SEPARATOR.'->'.get_class($dood) . '->'. $c->toSQL();
return $output;
Код: Выделить всё
Array ( [id] => 1 [name] => Правда Музыка ) F:\Yandex\Sites\modx\musiclabel\core\components\musiclabel\model\musiclabel\->MusicLabel->SELECT `` FROM AS `MusicLabel`
Вот мои файлы:
< Strong>F:\Yandex\Sites\modx\musiclabel\core\comComponents\musiclabel\model\muscilabel\musiclabel.class.php
Код: Выделить всё
musiclabel.assets_url = ml.modx.local/assets/comComponents/musiclabel/
musiclabel.core_path = F:\Yandex\Sites\modx\musiclabel\core\comComponents\musiclabel\
Подробнее здесь: https://stackoverflow.com/questions/626 ... tom-plugin