简体   繁体   English

Codeigniter-基本网址在<a href=“”>标记中</a>不起作用

[英]Codeigniter - Base URL not working within the <a href=“”> tag

Sorry for this stupid question. 很抱歉这个愚蠢的问题。 I have searched for this question on stackoverflow but couldn't get an answer to my exact question. 我已经在stackoverflow上搜索了此问题,但无法获得确切问题的答案。

Anyways. 无论如何。

This is my code: 这是我的代码:

$pid = $this->encrypt->encode($pid_info);
$data_user = array('first_name' => $first_name,
        'delete' => " <a href='base_url(profile/delete) . $pid'>Delete </a>");

But my URL is like http://localhost/profile/view_note/base_url(delete) instead of http://localhost/profile/delete/$pid 但是我的URL就像http://localhost/profile/view_note/base_url(delete)而不是http://localhost/profile/delete/$pid

Any help is greatly appreciated. 任何帮助是极大的赞赏。 THanks. 谢谢。

try to use like this: 尝试这样使用:

 $pid = $this->encrypt->encode($pid_info);
 $data_user = array(
   'first_name' => $first_name,
   'delete' => '<a href="'.base_url().'/profile/delete/'. $pid'">Delete </a>"
 );

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM