本文整理汇总了PHP中DOMElement::addClass方法的典型用法代码示例。如果您正苦于以下问题:PHP DOMElement::addClass方法的具体用法?PHP DOMElement::addClass怎么用?PHP DOMElement::addClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DOMElement
的用法示例。
在下文中一共展示了DOMElement::addClass方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareTableValue
public function prepareTableValue(StdClass $data = null, DOMElement $wrapper = null, Entry $entry = null)
{
$result = (object) array('value' => null);
if (isset($data->joined_id)) {
try {
$document = $wrapper->ownerDocument;
$driver = Extension::load('field_join');
$driver->addPublishHeaders($document);
$joined = Entry::loadFromId($data->joined_id);
$section = Section::loadFromHandle($joined->section);
$wrapper->addClass('field-join');
$wrapper->setValue($section->name);
/*
$more = $document->createElement('span');
$more->addClass('more');
$more->setValue(__('More'));
$wrapper->appendChild($more);
// Build data array:
$content = $document->createElement('div');
$more->appendChild($content);
foreach ($section->layout as $column) {
foreach ($column->fieldsets as $fieldset) {
$group = $document->createElement('div');
$group->addClass('list');
$content->appendChild($group);
if ($fieldset->name) $group->appendChild(
$document->createElement('h5', $fieldset->name)
);
$list = $document->createElement('dl');
$group->appendChild($list);
foreach ($fieldset->fields as $field_handle) {
$field = $section->fetchFieldByHandle($field_handle);
$title = $document->createElement('dt', $field->{'publish-label'});
$list->appendChild($title);
$item = $document->createElement('dd');
$list->appendChild($item);
$value = $field->prepareTableValue(
$joined->data()->{$field_handle},
$item, $joined
);
}
}
}
*/
return $wrapper;
} catch (Exception $e) {
// Keep the null value set above.
}
}
return parent::prepareTableValue($result, $link, $entry);
}