本文整理匯總了PHP中float::render方法的典型用法代碼示例。如果您正苦於以下問題:PHP float::render方法的具體用法?PHP float::render怎麽用?PHP float::render使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類float
的用法示例。
在下文中一共展示了float::render方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: render_field
/**
* render_field hook
* @param cs_form $form form object
* @return string the element html
*/
public function render_field(cs_form $form)
{
$id = $this->get_html_id();
$attributes = $this->get_attributes();
$this->tag = 'div';
$output = "<{$this->tag} id=\"{$id}\"{$attributes}>\n";
$required = $this->validate->has_value('required') ? '<span class="required">*</span>' : '';
$requiredafter = $requiredbefore = $required;
if ($this->required_position == 'before') {
$requiredafter = '';
$requiredbefore = $requiredbefore . ' ';
} else {
$requiredbefore = '';
$requiredafter = ' ' . $requiredafter;
}
if (!empty($this->title)) {
if ($this->tooltip == FALSE) {
$this->label_class .= " " . preg_replace("/cs_/i", "label-", get_class($this));
$this->label_class = trim($this->label_class);
$label_class = !empty($this->label_class) ? " class=\"{$this->label_class}\"" : "";
$output .= "<label for=\"{$id}\"{$label_class}>{$requiredbefore}" . $this->get_text($this->title) . "{$requiredafter}</label>\n";
} else {
if (!in_array('title', array_keys($this->attributes))) {
$this->attributes['title'] = strip_tags($this->get_text($this->title) . $required);
}
$id = $this->get_html_id();
$form->add_js("\$('#{$id}','#{$form->get_id()}').tooltip();");
}
}
$output .= $this->latitude->render($form);
$output .= $this->longitude->render($form);
$output .= "</{$this->tag}>\n";
return $output;
}