php - 添加到带有 id 的链接
问题描述
我想在 url 的末尾添加一个 id。我想要的预期网址是:https ://crm.mysite.com/Accounts/7227227
这是我到目前为止所拥有的:
public function getCustomerRepositoryUrl()
{
$link = 'https://crm.mysite.com/Accounts/';
$crmId = $this->contact->getCustomerRepositoryIdentifier();//this returns the id needed
$link .= crmId;
return $this->$link;
}
解决方案
我想你想回来$link
而不是$this->link
。
如果你的代码没有给你一个错误,你真的应该打开 PHP 错误,因为在开发时没有看到错误就像是在盲目驾驶。
推荐阅读
- tcl - 从 tcl 中的给定路径中删除大括号
- javascript - 尽管被捕获,但在生成器中抛出的错误完成了它
- java - FirebaseRecyclerAdapter DatabaseException:无法将 java.lang.String 类型的对象转换为 Posts 类型
- user-interface - 是否有现成的 UI 可以在 ASP.NET 中编辑数据库表?
- javascript - Simple React Native iOS App 未在 xcode 和命令行中运行
- delphi - 如何在匿名方法中捕获变量?
- jquery - 如何在传递给 api 之前对 Excel 工作表数据进行编码
- python - 在 Django rest api 中缓慢的互联网连接时更新数据
- r - 将不同(连续和有序)绘图类型组合到一个绘图中的问题
- php - 按相同的列值对结果进行分组