本文整理汇总了PHP中Embed\Request::getUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP Request::getUrl方法的具体用法?PHP Request::getUrl怎么用?PHP Request::getUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Embed\Request
的用法示例。
在下文中一共展示了Request::getUrl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* {@inheritdoc}
*/
public function __construct(Request $request, array $config = null)
{
$this->request = $request;
if (isset($config['adapter']['config'])) {
$this->config = array_replace($this->config, $config['adapter']['config']);
}
if (isset($config['providers'])) {
$this->providersConfig = $config['providers'];
}
if (isset($config['image']['class'])) {
$this->imageClass = $config['image']['class'];
}
if (isset($config['image']['config'])) {
$this->imageConfig = $config['image']['config'];
}
$this->run();
//if the canonical url is different, repeat the proccess
$canonical = $this->getUrl();
if ($request->getUrl() !== $canonical) {
$request = $request->withUrl($canonical);
if ($request->isValid()) {
$this->request = $request;
$this->run();
}
}
}
示例2: getUrl
/**
* {@inheritdoc}
*/
public function getUrl()
{
return Utils::getFirstValue(Utils::getData($this->providers, 'url', $this->request)) ?: $this->request->getUrl();
}