Last active
December 17, 2015 19:39
-
-
Save maxpoletaev/5661702 to your computer and use it in GitHub Desktop.
Snippet for MODx Revolution. Displays the desired field from the resource.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!isset($id) || !isset($field)) return; | |
$resource = $modx->getObject('modResource', $id); | |
if (!$resource) return; | |
$data = $resource->toArray(); | |
if (isset($data[$field])) { | |
return $data[$field]; | |
} else { | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment