【问题标题】:Customize $this->Html->link() As per HTML根据 HTML 自定义 $this->Html->link()
【发布时间】:2015-01-06 22:42:03
【问题描述】:

我有这个 html 代码,但在 cakephp 上创建链接时遇到问题!

这是html代码!

 <li>
       <a href="#">
        <i class="fa fa-angle-double-right"></i> 
        Morris
      </a>

    </li>

我想把它做成这样,cakephp 方式!

<li>
<?php echo $this->Html->link(__('list'),
              array(
                'controller'=>'transactions',
                'action'=>'index'
              )

           ); ?>
</li>

但我对此有疑问,我将把它放在哪里以及如何放置:

我希望它是这样的

https://drive.google.com/file/d/0Bw9K-whE0SuvQkhUQy14T2lacjQ/view?usp=sharing

【问题讨论】:

标签: php cakephp cakephp-2.0 cakephp-2.3 helpers


【解决方案1】:

使用

echo $this->Html->link(
   '<i class="fa fa-angle-double-right"></i>',
    array(
      'controller'=>'transactions',
      'action'=>'index'
    ),
    array(
      'escape'=>false  //NOTICE THIS LINE ***************
    )
);

【讨论】:

  • @NoNation 嗨,如果它解决了问题,您可以接受答案(绿色检查按钮)。谢谢
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2015-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多