Cakephp3:如何在问号后使用获取参数获取完整url到当前页面
Cakephp3: how to get full url to the current page with get parameters after interrogation mark
我正在尝试获得全电流 url。在我的 ctp 文件中,我试过:
$this->Url->build(null, true)
或者
$this->request->here;
并尝试了控制器文件:
use Cake\Routing\Router;
Router::url(null, true)
但是none那些return问号后的所有参数。
use Cake\View\Helper\UrlHelper
$this->Url->build($this->request->here(), true);
或
use Cake\Routing\Router
Router::url($this->request->here(), true);
两者对您的 CTP 文件的作用相同
基于documentation,你可以得到当前的请求URL,包括querystring参数,像这样:
$this->request->here(false)
我正在尝试获得全电流 url。在我的 ctp 文件中,我试过:
$this->Url->build(null, true)
或者
$this->request->here;
并尝试了控制器文件:
use Cake\Routing\Router;
Router::url(null, true)
但是none那些return问号后的所有参数。
use Cake\View\Helper\UrlHelper
$this->Url->build($this->request->here(), true);
或
use Cake\Routing\Router
Router::url($this->request->here(), true);
两者对您的 CTP 文件的作用相同
基于documentation,你可以得到当前的请求URL,包括querystring参数,像这样:
$this->request->here(false)