本文整理汇总了PHP中Service::Url方法的典型用法代码示例。如果您正苦于以下问题:PHP Service::Url方法的具体用法?PHP Service::Url怎么用?PHP Service::Url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Service
的用法示例。
在下文中一共展示了Service::Url方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Url
/**
* Returns the selected endpoint URL of this Service
*
* @param string $resource - a child resource. For example,
* passing 'servers' would return .../servers. Should *not* be
* prefixed with a slash (/).
* @param array $args (optional) an array of key-value pairs for query
* strings to append to the URL
* @returns string - the requested URL
*/
public function Url($resource = '', $args = array())
{
$baseurl = parent::Url();
if ($resource != '') {
$baseurl = noslash($baseurl) . '/' . $resource;
}
if (!empty($args)) {
$baseurl .= '?' . $this->MakeQueryString($args);
}
return $baseurl;
}
示例2: Url
/**
* Returns the URL of the service, selected from the connection's
* serviceCatalog
*/
public function Url($param = array())
{
return noslash(parent::Url($param));
}
示例3: __construct
/**
* Called when creating a new Compute service object
*
* _NOTE_ that the order of parameters for this is *different* from the
* parent Service class. This is because the earlier parameters are the
* ones that most typically change, whereas the later ones are not
* modified as often.
*
* @param \OpenCloud\Identity $conn - a connection object
* @param string $serviceRegion - identifies the region of this Compute
* service
* @param string $urltype - identifies the URL type ("publicURL",
* "privateURL")
* @param string $serviceName - identifies the name of the service in the
* catalog
*/
public function __construct(OpenStack $conn, $serviceType, $serviceName, $serviceRegion, $urltype)
{
$this->debug(_('initializing Nova...'));
parent::__construct($conn, $serviceType, $serviceName, $serviceRegion, $urltype);
$this->_url = noslash(parent::Url());
}