Last active
August 17, 2017 09:41
-
-
Save qwersk/025c09ad7c2e7621b5403bd123f6077f to your computer and use it in GitHub Desktop.
Get custom fields #JOOMLA
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
$customFieldnames = FieldsHelper::getFields('com_content.article', $item->id, true); | |
$customFieldIds = array_map(create_function('$o', 'return $o->id;'), $customFieldnames); //get custom field Ids by custom field names | |
$model = JModelLegacy::getInstance('Field', 'FieldsModel', array('ignore_request' => true)); //load fields model | |
$customFieldValues = $model->getFieldValues($customFieldIds , $item->id); //Fetch values for custom field Ids |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment