AdminPageFramework_FieldType_checkbox::getField PHP Метод

getField() защищенный Метод

protected getField ( $aField )
    protected function getField($aField)
    {
        $_aOutput = array();
        $_bIsMultiple = is_array($aField['label']);
        foreach ($this->getAsArray($aField['label'], true) as $_sKey => $_sLabel) {
            $_aOutput[] = $this->_getEachCheckboxOutput($aField, $_bIsMultiple ? $_sKey : '', $_sLabel);
        }
        return "<div " . $this->getAttributes($this->_getCheckboxContainerAttributes($aField)) . ">" . "<div class='repeatable-field-buttons'></div>" . implode(PHP_EOL, $_aOutput) . "</div>";
    }

Usage Example

 /**
  * Returns the output of the field type.
  * 
  * Returns the output of post type checklist check boxes.
  * 
  * @remark      the posttype checklist field does not support multiple elements by passing an array of labels.
  * @since       2.0.0
  * @since       2.1.5       Moved from AdminPageFramework_FormField.
  * @since       3.0.0       Reconstructed entirely.
  * @since       3.3.1       Changed from `_replyToGetField()`.
  */
 protected function getField($aField)
 {
     $this->_sCheckboxClassSelector = '';
     // disable the checkbox class selector.
     $aField['label'] = $this->_getPostTypeArrayForChecklist(isset($aField['slugs_to_remove']) ? $this->getAsArray($aField['slugs_to_remove']) : $this->aDefaultRemovingPostTypeSlugs, $aField['query'], $aField['operator']);
     return parent::getField($aField);
 }
All Usage Examples Of AdminPageFramework_FieldType_checkbox::getField