首页 > 解决方案 > 添加到带有 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;
    }

标签: phpfunctionurl

解决方案


我想你想回来$link而不是$this->link

如果你的代码没有给你一个错误,你真的应该打开 PHP 错误,因为在开发时没有看到错误就像是在盲目驾驶。


推荐阅读