本文整理匯總了PHP中Embed\Request::getDomain方法的典型用法代碼示例。如果您正苦於以下問題:PHP Request::getDomain方法的具體用法?PHP Request::getDomain怎麽用?PHP Request::getDomain使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Embed\Request
的用法示例。
在下文中一共展示了Request::getDomain方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getProviderUrl
/**
* {@inheritdoc}
*/
public function getProviderUrl()
{
return Utils::getFirstValue(Utils::getData($this->providers, 'providerUrl', $this->request)) ?: $this->request->getScheme() . '://' . $this->request->getDomain(true);
}
示例2: getEndPointFromRequest
/**
* Returns the oembed link from the request
*
* @param Request $request
* @param array $config
*
* @return array|null
*/
protected static function getEndPointFromRequest(Request $request, array $config)
{
//Search the oembed provider using the domain
$class = 'Embed\\Providers\\OEmbed\\' . str_replace(' ', '', ucwords(strtolower(str_replace('-', ' ', $request->getDomain()))));
if (class_exists($class) && $request->match($class::getPatterns())) {
return ['endPoint' => $class::getEndpoint(), 'params' => $class::getParams($request)];
}
//Search using embedly
if (!empty($config['embedlyKey']) && $request->match(OEmbed\Embedly::getPatterns())) {
return ['endPoint' => OEmbed\Embedly::getEndpoint(), 'params' => OEmbed\Embedly::getParams($request) + ['key' => $config['embedlyKey']]];
}
}
示例3: getClassFromRequest
/**
* Return the class name implementing an oEmbed provider
* @param Request $request
*
* @return string
*/
protected static function getClassFromRequest(Request $request)
{
return 'Embed\\Providers\\OEmbed\\' . str_replace(' ', '', ucwords(strtolower(str_replace('-', ' ', $request->getDomain()))));
}