本文整理汇总了PHP中Brick::text方法的典型用法代码示例。如果您正苦于以下问题:PHP Brick::text方法的具体用法?PHP Brick::text怎么用?PHP Brick::text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Brick
的用法示例。
在下文中一共展示了Brick::text方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: time
public static function time($timestamp, $format = 'short', $classes = '')
{
$brick = new Brick('time');
$brick->datetime = Date::format($timestamp, 'iso');
$brick->text(Date::format($timestamp, $format));
$brick->addClass($classes);
return $brick;
}
示例2: alert
public function alert($alert = null)
{
if (!is_null($alert)) {
$this->alert = $alert;
return $this;
}
if (is_null($this->alert)) {
return null;
}
$message = $this->alert;
$alert = new Brick('div');
$alert->addClass('message message-is-alert');
$alert->append(function () use($message) {
$content = new Brick('span');
$content->addClass('message-content');
$content->text($message);
return $content;
});
$alert->append(function () {
$toggle = new Brick('span');
$toggle->addClass('message-toggle');
$toggle->html('<i>×</i>');
return $toggle;
});
return $alert;
}
示例3: deleteLink
/**
* Get a link that allows to delete the comment. Only available to registered
* users.
*
* @return Brick|string
*/
public function deleteLink()
{
// Ensure the current user is allowed to edit the comment
if (!$this->exists || !$this->currentUserCan('delete')) {
return '';
}
$uri = $this->page()->uri();
$hash = $this->page()->hash();
$id = $this->id();
$link = new Brick('a');
$link->attr('href', $this->actionUrl('delete'));
$link->data('href', $this->actionUrl('delete', true));
$link->addClass('comment-delete-link js-delete');
$link->text(l('comments.comment.delete', 'Delete'));
return $link;
}