本文整理匯總了PHP中type::getUrl方法的典型用法代碼示例。如果您正苦於以下問題:PHP type::getUrl方法的具體用法?PHP type::getUrl怎麽用?PHP type::getUrl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類type
的用法示例。
在下文中一共展示了type::getUrl方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _generateElement
/**
* Create one element
*
* @param type $node
*/
private function _generateElement($node)
{
if (!$node->isAllow()) {
return;
}
$cssClasses = array();
$cssActive = '';
if ($node->isActive()) {
$cssActive = 'class="active"';
}
if (!is_null($node->getClass())) {
$cssClasses[] = $node->getClass();
}
$class = count($cssClasses) > 0 ? " class='" . implode(',', $cssClasses) . "'" : '';
$id = !is_null($node->getId()) ? " id='" . $node->getId() . "'" : '';
$target = !is_null($node->getTarget()) ? " target='" . $node->getTarget() . "'" : '';
$this->html .= "\t\t" . '<li ' . $cssActive . '>' . PHP_EOL;
if (!$node->hasChilds()) {
$this->html .= "\t\t\t" . '<a href="' . $node->getUrl() . '" ' . $target . ' class="nav-header" ><span' . $class . '></span> ' . $this->_translate($node->getName()) . "</a>" . PHP_EOL;
}
//generate childs
if ($node->hasChilds()) {
//$this->html .= "\t\t<div class='dropdown'>" . PHP_EOL;
$this->html .= '<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">' . $this->_translate($node->getName()) . ' <span class="caret"></span></a>' . PHP_EOL;
$this->html .= "\t\t<ul class=\"dropdown-menu\">" . PHP_EOL;
$this->_generateChilds($node->getChilds());
$this->html .= "\t\t</ul>" . PHP_EOL;
//$this->html .= "\t\t</div>" . PHP_EOL;
}
$this->html .= "\t\t</li>" . PHP_EOL;
}
示例2: createJSONUserInfo
/**
* Creates an single user-information array for a given user. A user will be marked
* as disabled, if the permission check fails on this user.
*
* @param type $user
* @param type $permission
* @return type
*/
private static function createJSONUserInfo($user, $permission = null, $priority = null)
{
$disabled = false;
if ($permission != null && $permission instanceof \humhub\libs\BasePermission) {
$disabled = !$user->getPermissionManager()->can($permission);
} else {
if ($permission != null) {
$disabled = $permission;
}
}
$priority = $priority == null ? 0 : $priority;
$userInfo = [];
$userInfo['id'] = $user->id;
$userInfo['guid'] = $user->guid;
$userInfo['disabled'] = $disabled;
$userInfo['displayName'] = Html::encode($user->displayName);
$userInfo['image'] = $user->getProfileImage()->getUrl();
$userInfo['priority'] = $priority;
$userInfo['link'] = $user->getUrl();
return $userInfo;
}
示例3: _generateElement
/**
* Create one element
*
* @param type $node
*/
private function _generateElement($node)
{
$cssClasses = array();
if ($node->isActive()) {
$cssClasses[] = 'active';
}
if (!is_null($node->getClass())) {
$cssClasses[] = $node->getClass();
}
$class = count($cssClasses) > 0 ? " class='" . implode(',', $cssClasses) . "'" : '';
$id = !is_null($node->getId()) ? " id='" . $node->getId() . "'" : '';
$target = !is_null($node->getTarget()) ? " target='" . $node->getTarget() . "'" : '';
$this->html .= "\t\t<li{$class} {$id}>" . PHP_EOL;
$this->html .= "\t\t\t<a title='" . $this->_translate($node->getName()) . "' href='" . $node->getUrl() . "' {$target}>" . $this->_translate($node->getName()) . "</a>" . PHP_EOL;
//generate childs
if ($node->hasChilds()) {
$this->html .= "\t\t<div class='dropdown'>" . PHP_EOL;
$this->html .= "\t\t<ul>" . PHP_EOL;
$this->_generateChilds($node->getChilds());
$this->html .= "\t\t</ul>" . PHP_EOL;
$this->html .= "\t\t</div>" . PHP_EOL;
}
$this->html .= "\t\t</li>" . PHP_EOL;
}
示例4: invokeRpcAndDeserializeResponse
/**
* @deprecated
* @param type $apiEndpoint
* @param type $contentType
* @param type $payload
* @param type $responseContentType
* @param type $responsePayload
* @return type
*/
protected function invokeRpcAndDeserializeResponse($apiEndpoint, $contentType, $responseContentType, &$deserializedPayload)
{
//
// Create responsePayload variable to pass by reference to
// HttpsRpc::invoke.
//
$responsePayload = null;
//
// Log request
//
self::log(\Psr\Log\LogLevel::DEBUG, "ApiRequest::invokeRpcAndDeserializeResponse [" . "endpoint=\"{endpoint}\", " . "contentType=\"{contentType}\", " . "responseContentType=\"{responseContentType}\"" . "]", array('endpoint' => $apiEndpoint != null ? $apiEndpoint->getUrl() : 'null', 'contentType' => $contentType, 'responseContentType' => $responseContentType));
//
//
//
$responseCode = HttpsRpc::invoke($apiEndpoint->getUrl(), $contentType, $this, $responseContentType, $deserializedPayload);
return $responseCode;
}
示例5: getAssetUrl
/**
* Returns the public path of an asset.
*
* Absolute paths (i.e. http://...) are returned unmodified.
*
* @param string $path A public path
* @param string $packageName The name of the asset package to use
*
* @return string A public path which takes into account the base path and URL path
*/
public function getAssetUrl($path, $packageName = null)
{
return $this->assetsHelper->getUrl($path, $packageName);
}