本文整理汇总了PHP中yii\helpers\Html::beginTag方法的典型用法代码示例。如果您正苦于以下问题:PHP Html::beginTag方法的具体用法?PHP Html::beginTag怎么用?PHP Html::beginTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\helpers\Html
的用法示例。
在下文中一共展示了Html::beginTag方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: printTree
private function printTree($array, $level = 0, $parent = 0)
{
if ($this->groupOptions instanceof \Closure) {
$func = $this->groupOptions;
$groupOptions = $func($array, $level, $parent, $this->id);
} else {
$groupOptions = $this->groupOptions;
}
$groupOptions = array_merge(['id' => $this->id . '-navi-' . $parent], $groupOptions);
$result = \yii\helpers\Html::beginTag($this->groupTag, $groupOptions);
foreach ($array as $key => $val) {
if ($this->elementOptions instanceof \Closure) {
$func = $this->elementOptions;
$elementOptions = $func($val, $level, $parent, $this->id);
} else {
$elementOptions = $this->elementOptions;
}
$result .= \yii\helpers\Html::beginTag($this->elementTag, $elementOptions);
if ($this->value instanceof \Closure) {
$value = $this->value;
$result .= $value($val, $level);
} else {
$result .= $val['title'];
}
$result .= \yii\helpers\Html::endTag($this->elementTag);
$result .= $val[$this->childAttribute] ? self::printTree($val[$this->childAttribute], $level + 1, $val['id']) : '';
}
$result .= \yii\helpers\Html::endTag($this->groupTag);
return $result;
}
示例2: run
public function run()
{
SelectAsset::register($this->view);
FilterAsset::register($this->view);
$values = [];
foreach ($this->data as $value) {
$value = strval($value);
$values[$value] = $value;
}
if (!$this->default) {
$this->default = $this->multiple ? array_keys($values) : key($values);
}
$selected = $this->selected($this->default);
// Setup options
$options = ['id' => $this->name, 'name' => $this->name . '[]', 'style' => 'width: 300px;', 'class' => 'selectpicker'];
$extra = ['title' => 'Not selected'];
if ($this->multiple) {
$extra['multiple'] = 'multiple';
}
if ($this->placeholder) {
$extra['title'] = strval($this->placeholder);
}
$options = array_merge($options, $extra);
if (!$this->method) {
$this->method = 'get';
}
// Render
echo Html::beginForm(Url::canonical(), $this->method, ['data-pjax' => '1', 'id' => $this->name]);
echo Html::beginTag('select', $options, ['data-pjax' => '1']);
echo Html::renderSelectOptions($selected, $values);
echo Html::endTag("select");
echo Html::endForm();
parent::run();
}
示例3: run
/**
* Renders the widget.
*/
public function run()
{
echo Html::beginTag('div', $this->options) . "\n";
echo $this->renderBar($this->label) . "\n";
echo Html::endTag('div') . "\n";
$this->registerPlugin('progress');
}
示例4: run
/**
* @inheritdoc
*/
public function run()
{
if ($this->box) {
self::boxBegin($this->box);
}
echo Html::beginTag('ul', ['class' => 'timeline', 'id' => $this->options['id']]);
foreach ($this->data as $datum) {
echo Html::beginTag('li', ['class' => 'time-label']);
echo Html::tag('span', $datum['date']);
echo Html::endTag('li');
foreach ($datum['items'] as $item) {
echo Html::beginTag('li');
echo Html::tag('i', null, ['class' => 'fa fa-envelope']);
echo Html::beginTag('div', ['class' => 'timeline-item']);
echo Html::beginTag('span', ['class' => 'time']);
echo Html::tag('i', null, ['class' => 'fa fa-clock-o']);
echo ' ' . $item['time'];
echo Html::endTag('span');
echo Html::tag('h3', $item['header'], ['class' => 'timeline-header']);
echo Html::tag('div', $item['body'], ['class' => 'timeline-body']);
echo Html::tag('div', $item['footer'], ['class' => 'timeline-footer']);
echo Html::endTag('div');
echo Html::endTag('li');
}
}
echo Html::endTag('ul');
if ($this->box) {
self::boxEnd();
}
}
示例5: init
public function init()
{
$view = $this->getView();
FormAsset::register($view);
$this->options['is'] = $this->tagName;
echo Html::beginTag('form', $this->options);
}
示例6: run
/**
* Renders the widget.
*/
public function run()
{
echo Html::beginTag('div', $this->options) . "\n";
echo $this->renderProgress() . "\n";
echo Html::endTag('div') . "\n";
UIkitAsset::register($this->getView());
}
示例7: run
/**
*
*/
public function run()
{
echo Html::beginTag('section', ['class' => 'top-bar-section']);
echo $this->renderItems();
echo Html::endTag('section');
FoundationAsset::register($this->getView());
}
示例8: generateButton
public function generateButton()
{
echo Html::beginTag('div', ['class' => 'input-group-btn']);
echo Html::a('<i class="fa fa-minus"></i>', '#', ['id' => $this->getId() . '_del', 'class' => 'btn btn-danger']);
echo Html::a('<i class="fa fa-plus"></i>', '#', ['id' => $this->getId() . '_add', 'class' => 'btn btn-success']);
echo Html::endTag('div');
}
示例9: run
public function run()
{
echo Html::beginTag('img', $this->options);
$this->options['src'] = ArrayHelper::remove($this->options, 'data-src');
Html::removeCssClass($this->options, 'lazy');
echo '<noscript>' . Html::beginTag('img', $this->options) . '</noscript>';
}
示例10: init
/**
* @inheritdoc
*/
public function init()
{
if (!isset($this->options['id'])) {
$this->options['id'] = $this->getId();
}
echo Html::beginTag('div', $this->options);
}
示例11: run
public function run()
{
$component = \Yii::$app->get('moderatorPanel');
/** @var Component $component */
$items = [];
foreach ($component->getWidgets() as $widget) {
$content = call_user_func([$widget['class'], 'widget'], $widget['options']);
if (!empty($content)) {
$items[] = $content;
}
}
if (!empty($items)) {
echo Html::tag('div', 'MP', ['id' => 'moderator-panel-open-button', 'onclick' => 'mihaildev.moderatorPanel.buttonClick()']);
echo Html::beginTag('div', ['id' => 'moderator-panel-frame']);
echo Html::beginTag('div', ['id' => 'moderator-panel-frame-header']);
echo Html::tag('div', '×', ['id' => 'moderator-panel-frame-close', 'onclick' => 'mihaildev.moderatorPanel.closeFrame()']);
echo Html::tag('div', 'Title', ['id' => 'moderator-panel-frame-title']);
echo Html::endTag('div');
echo Html::beginTag('div', ['id' => 'moderator-panel-frame-body']);
echo Html::endTag('div');
echo Html::endTag('div');
echo Html::beginTag('div', ['id' => 'moderator-panel']);
echo Html::beginTag('div', ['id' => 'moderator-panel-header']);
echo Html::tag('div', '×', ['id' => 'moderator-panel-close', 'onclick' => 'mihaildev.moderatorPanel.buttonClick()']);
echo Html::tag('div', 'MP', ['id' => 'moderator-panel-title']);
echo Html::endTag('div');
echo Html::beginTag('ul', ['id' => 'moderator-panel-menu']);
echo '<li>' . implode('</li><li>', $items) . "</li>";
echo Html::endTag('ul');
echo Html::endTag('div');
echo '<style>' . $this->getView()->renderPhpFile(__DIR__ . '/assets/css.css') . '</style>';
echo '<script>' . $this->getView()->renderPhpFile(__DIR__ . '/assets/js.js') . '</script>';
}
}
示例12: init
public function init()
{
parent::init();
Html::addCssClass($this->options, 'ui message');
if ($this->icon) {
Html::addCssClass($this->options, self::TYPE_ICON);
}
if ($this->hidden) {
Html::addCssClass($this->options, self::TYPE_HIDDEN);
}
if ($this->visible) {
Html::addCssClass($this->options, self::TYPE_VISIBLE);
}
if ($this->floating) {
Html::addCssClass($this->options, self::TYPE_FLOATING);
}
if ($this->compact) {
Html::addCssClass($this->options, self::TYPE_COMPACT);
}
if ($this->attached) {
Html::addCssClass($this->options, self::TYPE_ATTACHED);
}
if ($this->size) {
Html::addCssClass($this->options, $this->size);
}
if ($this->color) {
Html::addCssClass($this->options, $this->color);
}
if ($this->type) {
Html::addCssClass($this->options, $this->type);
}
echo Html::beginTag('div', $this->options);
}
示例13: run
public function run()
{
Assets::register($this->getView());
echo Html::beginTag('div', $this->containerOptions);
if ($this->hasModel()) {
echo Html::activeTextarea($this->model, $this->attribute, $this->options);
} else {
echo Html::textarea($this->name, $this->value, $this->options);
}
echo Html::endTag('div');
$js = ['bajadev.ckEditor.registerOnChange(' . Json::encode($this->options['id']) . ');'];
if (isset($this->editorOptions['filebrowserUploadUrl'])) {
$js[] = "bajadev.ckEditor.registerCsrf();";
}
if (!isset($this->editorOptions['on']['instanceReady'])) {
$this->editorOptions['on']['instanceReady'] = new JsExpression("function( ev ){" . implode(' ', $js) . "}");
}
if ($this->_inline) {
$JavaScript = "CKEDITOR.inline(";
$JavaScript .= Json::encode($this->options['id']);
$JavaScript .= empty($this->editorOptions) ? '' : ', ' . Json::encode($this->editorOptions);
$JavaScript .= ");";
$this->getView()->registerJs($JavaScript, View::POS_END);
$this->getView()->registerCss('#' . $this->containerOptions['id'] . ', #' . $this->containerOptions['id'] . ' .cke_textarea_inline{height: ' . $this->editorOptions['height'] . 'px;}');
} else {
$JavaScript = "CKEDITOR.replace(";
$JavaScript .= Json::encode($this->options['id']);
$JavaScript .= empty($this->editorOptions) ? '' : ', ' . Json::encode($this->editorOptions);
$JavaScript .= ");";
$this->getView()->registerJs($JavaScript, View::POS_END);
}
}
示例14: run
/**
* Renders the widget.
* @return string
*/
public function run()
{
echo Html::a('', false, ['name' => 'footer']);
echo Html::beginTag('footer', ['class' => 'c-layout-footer c-layout-footer-4 c-bg-footer-8']);
echo Html::beginTag('div', ['class' => 'c-footer']);
echo Html::beginTag('div', ['class' => 'container']);
echo Html::beginTag('div', ['class' => 'row']);
echo Html::beginTag('div', ['class' => 'col-md-6 c-footer-4-p-right']);
echo Html::beginTag('div', ['class' => 'c-content-title-1']);
echo Html::tag('h3', $this->title, ['class' => 'c-font-uppercase c-font-bold c-font-white c-border']);
echo Html::endTag('div');
echo Html::tag('p', $this->about, ['class' => 'c-about']);
echo Html::tag('ul', $this->social, ['class' => 'c-socials']);
echo Html::endTag('div');
echo Html::beginTag('div', ['class' => 'col-md-6 c-footer-4-p-right']);
echo Html::beginTag('div', ['class' => 'c-feedback']);
echo Html::tag('h3', 'CONTACT', ['class' => 'c-font-thin']);
echo Html::tag('p', $this->contact, ['class' => 'c-contact c-font-white']);
echo Html::endTag('div');
echo Html::endTag('div');
echo Html::endTag('div');
echo Html::endTag('div');
echo Html::endTag('div');
echo Html::endTag('footer');
}
示例15: init
/**
* Initializes the widget.
*/
public function init()
{
parent::init();
echo Html::beginTag('div', ['class' => 'modal fade', 'id' => $this->modalId, 'role' => "dialog"]);
echo Html::beginTag('div', ['class' => 'modal-dialog ' . $this->modalSize]);
echo Html::beginTag('div', ['class' => 'modal-content']);
echo Html::beginTag('div', ['class' => 'modal-header']);
echo Html::beginTag('button', ['type' => "button", 'class' => "close", 'data-dismiss' => "modal"]);
echo Html::beginTag('span', ['aria-hidden' => "true"]);
echo "×";
echo Html::endTag('span');
echo Html::beginTag('span', ['class' => "sr-only"]);
echo "Close";
echo Html::endTag('span');
echo Html::endTag('button');
echo Html::beginTag('h4', ['class' => "modal-title"]);
echo Html::endTag('h4');
echo Html::endTag('div');
echo Html::beginTag('div', ['class' => 'modal-body']);
echo Html::beginTag('div', ['class' => 'content', 'style' => 'overflow:auto;']);
echo Html::endTag('div');
echo Html::endTag('div');
/* modal-footer tak hapus. Kayaknya ga pernah kepake. Biar tampilan modalnya bagus, ga ada garis bawah pengganggu
echo Html::beginTag('div', ['class'=>'modal-footer']);
echo Html::endTag('div');*/
echo Html::endTag('div');
echo Html::endTag('div');
echo Html::endTag('div');
if ($this->registerAsset) {
ModalAsset::register($this->getView());
}
}