【问题标题】:Cakephp html link with image + text, without using cssCakephp html 带有图像+文本的链接,不使用 css
【发布时间】:2012-12-03 11:47:57
【问题描述】:

如何使用 cakephp Html 帮助器创建包含文本和图像的 html 链接,如下所示

<a href="#">
    <img src="images/icons/web-app/48/add-user.png" width="48" height="48"> Add User
</a>

我想要最终结果

我知道我可以用 css 做到这一点,但我只想知道如何使用 cakephp

【问题讨论】:

    标签: cakephp


    【解决方案1】:
    echo $this->Html->link($this->Html->image('design/unige_logo.png', array('width' => '48', 'height' => '48')) . ' ' . __('Add user'),
                           '#',
                           array('escape' => false));
    

    【讨论】:

    • @nIco 先生,如果文本在图像之前怎么办?
    • @SOS 然后只需交换第一行的文本和图像
    • @niCo 我想交换它但它提示语法错误,你能详细说明交换吗?
    猜你喜欢
    • 2023-03-26
    • 2012-07-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-20
    • 1970-01-01
    • 2017-11-20
    • 2018-04-02
    相关资源
    最近更新 更多