本文整理匯總了PHP中DOMElement::setValue方法的典型用法代碼示例。如果您正苦於以下問題:PHP DOMElement::setValue方法的具體用法?PHP DOMElement::setValue怎麽用?PHP DOMElement::setValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DOMElement
的用法示例。
在下文中一共展示了DOMElement::setValue方法的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);
}