本文整理汇总了PHP中Element::render_inner_html方法的典型用法代码示例。如果您正苦于以下问题:PHP Element::render_inner_html方法的具体用法?PHP Element::render_inner_html怎么用?PHP Element::render_inner_html使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Element
的用法示例。
在下文中一共展示了Element::render_inner_html方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render_inner_html
/**
* Renders the button and drop down trigger button.
*
* The `btn-primary`, `btn-danger`, `btn-success` and `btn-info` class names are forwarded to
* the buttons.
*/
protected function render_inner_html()
{
$label = parent::render_inner_html();
$class_names = array_intersect_key(['btn-primary' => true, 'btn-danger' => true, 'btn-success' => true, 'btn-info' => true], $this->class_names);
$class = implode(' ', array_keys(array_filter($class_names)));
return $this->render_splitbutton_label($label, $class) . $this->render_splitbutton_toggle($class) . $this->resolve_options($this[self::OPTIONS]);
}
示例2: render_inner_html
/**
* Renders the button and drop down trigger button.
*
* The `btn-*` class names are forwarded to the buttons.
*
* @inheritdoc
*/
protected function render_inner_html()
{
$label = parent::render_inner_html();
$class = parent::render_class(array_filter($this->class_names, function ($class_name) {
return strpos($class_name, 'btn-') === 0 || $class_name === 'disabled';
}, ARRAY_FILTER_USE_KEY));
return $this->render_splitbutton_label($label, $class) . $this->render_splitbutton_toggle($class) . $this->resolve_options($this[self::OPTIONS]);
}
示例3: render_inner_html
/**
* Renders the actions.
*
* If actions are defined as the string "boolean" they are replaced by an array with the
* buttons `button[data-action="cancel"]` and
* `button[data-action="ok"][type=submit].btn-primary`.
*
* If actions are defined as a boolean, they are replaced by a
* `button[type=submit][data-action="ok"].btn-primary` element with the label "Send".
*
* If actions are defined as an array, the array is concatenated with the glue
* `<span class="separator"> </span>`.
*
* Otherwise actions are used as is.
*/
protected function render_inner_html()
{
$html = parent::render_inner_html();
$actions = $this->actions;
if ($actions == 'boolean') {
$actions = [new Button('Cancel', ['data-action' => 'cancel']), new Button('Ok', ['data-action' => 'ok', 'type' => 'submit', 'class' => 'btn-primary'])];
}
if (is_array($actions)) {
foreach ($actions as $name => $action) {
if (!is_string($name) || !$action instanceof Element || $action['name'] !== null) {
continue;
}
$action['name'] = $name;
}
$actions = implode($actions);
} else {
if ($actions === true) {
$actions = new Button('Ok', ['dataset' => ['action' => 'ok'], 'type' => 'submit', 'class' => 'btn-primary']);
}
}
return $html . $actions;
}
示例4: render_inner_html
/**
* Prepends the inner HTML with a description and a legend.
*
* If the {@link DESCRIPTION} attribute is defined the HTML is prepend with a
* `DIV.group-description>DIV.group-description-inner` element. The description is translated
* within the "group.description" scope. The description is not escaped.
*
* If the {@link LEGEND} attribute is defined the HTML is prepend with a `<LEGEND>` element.
* The legend can be provided as an object in which it is used _as is_, otherwise the legend
* is translated within the "group.legend" scope, then escaped.
*
* The legend element is rendered using the {@link render_group_legend()} method.
*
* @inheritdoc
*/
protected function render_inner_html()
{
$html = parent::render_inner_html();
if ($html === null) {
throw new ElementIsEmpty();
}
$description = $this[self::DESCRIPTION];
if ($description) {
$description = $this->t($description, [], ['scope' => 'group.description']);
$html = $this->render_group_description($description) . $html;
}
$legend = $this[self::LEGEND];
if ($legend) {
if (is_object($legend)) {
$legend = (string) $legend;
} else {
$legend = escape($this->t($legend, [], ['scope' => 'group.legend']));
}
$html = $this->render_group_legend($legend) . $html;
}
return $html;
}
示例5: render_modal_body
protected function render_modal_body()
{
return parent::render_inner_html();
}
示例6: render_inner_html
/**
* The inner HTML is wrapped in a number of DIV elements, and the title is used a the popover
* title.
*/
protected function render_inner_html()
{
$content = parent::render_inner_html();
$title = $this[self::TITLE];
if ($title) {
$title = '<h3 class="popover-title">' . escape($title) . '</h3>';
}
$actions = $this[self::ACTIONS];
if ($actions) {
$actions = $this->render_actions($actions);
}
return <<<EOT
<div class="arrow"></div>
<div class="popover-inner">{$title}<div class="popover-content">{$content}</div>{$actions}</div>
EOT;
}