本文整理匯總了PHP中TElement::tag方法的典型用法代碼示例。如果您正苦於以下問題:PHP TElement::tag方法的具體用法?PHP TElement::tag怎麽用?PHP TElement::tag使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TElement
的用法示例。
在下文中一共展示了TElement::tag方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
public function __construct()
{
parent::__construct('ul');
$this->class = 'dropdown-menu dropdown-messages';
$messages = array();
$messages[] = array(TSession::getValue('login'), 'Yesterday', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eleifend...');
$messages[] = array(TSession::getValue('login'), 'Yesterday', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eleifend...');
$messages[] = array(TSession::getValue('login'), 'Yesterday', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eleifend...');
$a = new TElement('a');
$a->{'class'} = "dropdown-toggle";
$a->{'data-toggle'} = "dropdown";
$a->{'href'} = "#";
$a->add(TElement::tag('i', '', array('class' => "fa fa-envelope fa-fw")));
$a->add(TElement::tag('span', count($messages), array('class' => "badge badge-notify")));
$a->add(TElement::tag('i', '', array('class' => "fa fa-caret-down")));
$a->show();
foreach ($messages as $message) {
$name = $message[0];
$date = $message[1];
$body = $message[2];
$li = new TElement('li');
$a = new TElement('a');
$div = new TElement('div');
$a->href = '#';
$li->add($a);
$a->add($div);
$div->add(TElement::tag('strong', $name));
$div->add(TElement::tag('span', TElement::tag('em', $date), array('class' => 'pull-right text-muted')));
$div2 = new TElement('div');
$div2->add($body);
$a->add($div2);
parent::add($li);
parent::add(TElement::tag('li', '', array('class' => 'divider')));
}
$li = new TElement('li');
$a = new TElement('a');
$li->add($a);
$a->class = 'text-center';
$a->href = '#';
$a->add(TElement::tag('strong', 'Read messages'));
$a->add($i = TElement::tag('i', '', array('class' => 'fa fa-inbox')));
parent::add($li);
parent::add(TElement::tag('li', '', array('class' => 'divider')));
$li = new TElement('li');
$a = new TElement('a');
$li->add($a);
$a->class = 'text-center';
$a->href = '#';
$a->add(TElement::tag('strong', 'Send message'));
$a->add($i = TElement::tag('i', '', array('class' => 'fa fa-envelope-o')));
parent::add($li);
}