doumei1772 2016-11-14 13:59
浏览 69
已采纳

删除yii2链接中的href值

I have a menu i have created in yii2 and i would like to remove the href value to #

This is what i have done

 <?php
            echo Menu::widget([
                'encodeLabels' => false,
                'options' => [
                    'class' => 'topnav menu-left-nest'
                ],
                'items' => [
                    [
                    'label' => ThemeNav::link('Manager action, 'fa fa-user'),

                    'url' => ["#"],  //this is the url {{i}}

                    'options' => ['class' => 'tooltip-tip'],
                    'items' => [

                      ...items in the dropdown
                          ],

When i check on the inspect element The above url ({{i}}) generates a value eg

<a href="/webwisekenya/advanced/backend/site/#"></a>

But i would like it to remain as

<a href="#"></a>

How do i go about this

This is the themenav class function link

public static function link($label, $icon = null) {

    $link = null;

    if (!empty($icon))
        $link .= Html::tag('i','',['class'=>$icon]);

    $link .= Html::tag('span', $label, []);

    return $link;

}
  • 写回答

2条回答 默认 最新

查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 关于#java#的问题,请各位专家解答!
  • ¥15 急matlab编程仿真二阶震荡系统
  • ¥20 TEC-9的数据通路实验
  • ¥15 ue5 .3之前好好的现在只要是激活关卡就会崩溃
  • ¥50 MATLAB实现圆柱体容器内球形颗粒堆积
  • ¥15 python如何将动态的多个子列表,拼接后进行集合的交集
  • ¥20 vitis-ai量化基于pytorch框架下的yolov5模型
  • ¥15 如何实现H5在QQ平台上的二次分享卡片效果?
  • ¥30 求解达问题(有红包)
  • ¥15 请解包一个pak文件