<?php
$curCtx = $modx->context->get('key');
$resources = call_user_func_array( array('modResource_mysql', 'load'),
array(& $modx, 'modResource', array('pagetitle' => $pagetitle, 'context_key' => $curCtx), true));
if ($resources != null)
echo $resources->get('id');This question has been answered by alezru. See the first response.
<?php
$curCtx = $modx->context->get('key');
if ($resource = $modx->getObject('modResource',array('pagetitle' => $pagetitle, 'context_key' => $curCtx))){
return $resource->get('id');
}
can't you just use this?It was like that, but i try some other variants and stops on that one, cuz they all do not work.....
<!--?php $curCtx = $modx--->context->get('key'); if ($resource = $modx->getObject('modResource',array('pagetitle' => $pagetitle, 'context_key' => $curCtx))){ return $resource->get('id'); }