用户
 找回密码
 入住 CI 中国社区
搜索
查看: 2096|回复: 1
收起左侧

[讨论/交流] 求解 在 HTML 表格类 table 中添加 base_url 等信息

[复制链接]
发表于 2011-8-28 16:51:06 | 显示全部楼层 |阅读模式
PHP复制代码
 
    $table_row [] = '<a href="#" title="Edit"><img src="resources/images/icons/pencil.png" alt="Edit" /></a>
                              <a href="#" title="Delete"><img src="resources/images/icons/cross.png" alt="Delete" /></a>
                            <a href="#" title="Edit Meta"><img src="resources/images/icons/hammer_screwdriver.png" alt="Edit Meta" /></a>'
;
            $this->table->add_row ( $table_row );
 
复制代码



<a href="#" title="Edit"><img src="resources/images/icons/pencil.png" alt="Edit" /></a>
<a href="#" title="Delete"><img src="resources/images/icons/cross.png" alt="Delete" /></a>
<a href="#" title="Edit Meta"><img src="resources/images/icons/hammer_screwdriver.png" alt="Edit Meta" /></a>

请问我要怎么在 <img src="resources/images/icons/pencil.png" alt="Edit" /> 中添加  base_url 信息啊  ?  纠结  不能 echo

发表于 2011-8-29 10:44:44 | 显示全部楼层
用heredoc方式。EOT或PRINT EOT。
再有,控制器输出表格,服务器压力比较大。最好还是在view中写入html标记,然后在需要的地方插入php代码。
另外,图片等类型资源,加入base_url后,就等于需要在web服务器中溜达一圈。如果你的图片资源都是本站的,不加也可。加不加,主要看设计和用途。如果虚拟主机,建议不加。

本版积分规则