this is what i have so far
<?php
class MyControllerHello extends modRestController {
public function beforePost() { return false; }
public function beforePut() { return false; }
public function beforeDelete() { return false; }
public $classKey = 'modResource';
public $defaultSortDirection = 'ASC';
public $defaultSortField = 'id';
public function prepareListObject(xPDOObject $object) {
$data = array();
$data['id'] = $object->id;
$data['pagetitle'] = $object->pagetitle;
$data['content'] = $object->content;
$data['introtext'] = $object->introtext;
$data['longtitle'] = $object->longtitle;
$data['description'] = $object->description;
$data['snippet'] = $object->$modx->runSnippet('hello');
return $data;
}
}
also the $data[‘snippet’] line fails and 500’s so thats what I was wondering was something I could do?
I guess I am starting small and just trying to get that to work but what I’d love to do future tense but didn’t wanna get that deep till I understood a bit more was, i wanted to just have a input for image, that would process by a snippet that would run something like phpthumb and give me back a URL of the image after its been manipulated, that way I can do the processing from the MODX side and the return JSON would contain the compiled / processed image at whatever dimentions i’d setup in the snippet.
am i not on the right track for that type of thing or can you think of a better way to get a processed phpthumb image into a string into a json key 