本文整理汇总了PHP中Field::handle方法的典型用法代码示例。如果您正苦于以下问题:PHP Field::handle方法的具体用法?PHP Field::handle怎么用?PHP Field::handle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Field
的用法示例。
在下文中一共展示了Field::handle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __wrapFieldWithDiv
private function __wrapFieldWithDiv(Field $field, Entry $entry = NULL)
{
$div = $this->createElement('div', NULL, array('class' => sprintf('field field-%s %s %s', $field->handle(), $field->required == 'yes' ? 'required' : '', $this->__calculateWidth($field->width))));
$field->displayPublishPanel($div, !is_null($entry) ? $entry->getData($field->id) : NULL, isset($this->_errors[$field->id]) ? $this->_errors[$field->id] : NULL, null, null, !is_null($entry) && is_numeric($entry->get('id')) ? $entry->get('id') : NULL);
return $div;
}
示例2: __wrapFieldWithDiv
/**
* Given a Field and Entry object, this function will wrap
* the Field's displayPublishPanel result with a div that
* contains some contextual information such as the Field ID,
* the Field handle and whether it is required or not.
*
* @param Field $field
* @param Entry $entry
* @return XMLElement
*/
private function __wrapFieldWithDiv(Field $field, Entry $entry)
{
$div = new XMLElement('div', NULL, array('id' => 'field-' . $field->get('id'), 'class' => 'field field-' . $field->handle() . ($field->get('required') == 'yes' ? ' required' : '')));
$field->displayPublishPanel($div, $entry->getData($field->get('id')), isset($this->_errors[$field->get('id')]) ? $this->_errors[$field->get('id')] : NULL, null, null, is_numeric($entry->get('id')) ? $entry->get('id') : NULL);
return $div;
}
示例3: __wrapFieldWithDiv
private function __wrapFieldWithDiv(Field $field, Entry $entry, $prefix = null, $postfix = null, $css = null)
{
$div = new XMLElement('div', NULL, array('class' => 'field field-' . $field->handle() . ($field->get('required') == 'yes' ? ' required' : '')));
if ($css != null) {
$div->setAttribute('style', $css);
}
$field->displayPublishPanel($div, $_POST['fields'][$field->get('element_name')], isset($this->_errors[$field->get('id')]) ? $this->_errors[$field->get('id')] : NULL, $prefix ? '[' . $prefix . ']' : null, null, is_numeric($entry->get('id')) ? $entry->get('id') : NULL);
return $div;
}