如何放置指向php set消息的链接
我对php非常陌生,我正在用蛋糕php编辑代码 我想在错误消息后添加到帮助页的链接: 现行守则:如何放置指向php set消息的链接,php,cakephp,Php,Cakephp,我对php非常陌生,我正在用蛋糕php编辑代码 我想在错误消息后添加到帮助页的链接: 现行守则: if (count($results) > 0) { $this->set("message", "Sorry, that data already exists."); return; } 大概是这样的: if (count($results) > 0) { $this->set("message", "Sorry, that data a
if (count($results) > 0) {
$this->set("message", "Sorry, that data already exists.");
return;
}
大概是这样的:
if (count($results) > 0) {
$this->set("message", "Sorry, that data already exists.") <a href="http://www.example.com/">;
return;
}
if(计数($results)>0){
$this->set(“消息”,“对不起,数据已经存在”);
回来
}
我应该在php代码中使用echo吗?它不适合我
谢谢尝试使用此代码
if (count($results) > 0) {
$this->set("message", "Sorry, that data already exists. <a href=\"http://www.example.com/\">Need help?</a>");
return;
}
if(计数($results)>0){
$this->set(“消息”,“对不起,数据已经存在”);
回来
}
$this->set(“消息”,“对不起,数据已经存在”);
执行此操作将使锚定作为字符串的一部分,如果需要回显它,则应将其生成为HTML。它只是:
if (count($results) > 0) {
$this->set("message", 'Sorry, that data already exists. <a href="http://www.example.com/">');
return;
}
if (count($results) > 0) {
$this->set("message", 'Sorry, that data already exists. <a href="http://www.example.com/">');
return;
}
if (count($results) > 0) {
$link = '<a href="http://www.example.com/">';
$this->set("message", "Sorry, that data already exists. $link");
return;
}