本文整理汇总了PHP中FRoute::external方法的典型用法代码示例。如果您正苦于以下问题:PHP FRoute::external方法的具体用法?PHP FRoute::external怎么用?PHP FRoute::external使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FRoute
的用法示例。
在下文中一共展示了FRoute::external方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _
/**
* Translates URL to SEF friendly
*
* External true SEF true
* http://solo.dev/joomla321/dashboard/registration/oauthDialog/facebook
* External true SEF false
* http://solo.dev/joomla321/index.php?option=com_easysocial&view=registration&layout=oauthDialog&client=facebook&Itemid=135
* External false SEF true
* /joomla321/dashboard/registration/oauthDialog/facebook
* External false SEF false
* index.php?option=com_easysocial&view=registration&layout=oauthDialog&client=facebook&Itemid=135
*
* @since 1.0
* @access public
* @param string
* @return
*/
public static function _($url, $xhtml = false, $view = array(), $ssl = null, $tokenize = false, $external = false, $tmpl = '', $controller = '', $sef = true)
{
if ($tokenize) {
$url .= '&' . FD::token() . '=1';
}
if (!empty($controller)) {
$url = $url . '&controller=' . $controller;
}
// If this is an external URL, we want to fetch the full URL.
if ($external) {
return FRoute::external($url, $xhtml, $ssl, $tmpl, $sef);
}
if (!empty($controller) && $sef) {
$url = JRoute::_($url, $xhtml);
return $url;
}
// We don't want to do any sef routing here.
// Only external = false and sef = false will come here
// IMPORTANT: handler needs to FRoute::_() the link
if ($tmpl == 'component' || $sef === false) {
return $url;
}
return JRoute::_($url, $xhtml, $ssl);
}
示例2:
"><?php
echo $user->getName();
?>
</a>
</div>
<div class="es-comment-actions " data-comments-item-actions>
<div class="es-comment-actions-flyout">
<a class="es-comment-actions-toggle" href="javascript:void(0);" data-bs-toggle="dropdown"><i class="icon-es-comment-action"></i></a>
<ul class="fd-nav fd-nav-stacked pull-right es-comment-actions-nav dropdown-menu">
<?php
if ($this->access->allowed('comments.report')) {
?>
<li>
<?php
echo FD::reports()->getForm('com_easysocial', 'comments', $comment->id, JText::sprintf('COM_EASYSOCIAL_COMMENTS_REPORT_ITEM_TITLE', $user->getName()), JText::_('COM_EASYSOCIAL_COMMENTS_REPORT_ITEM'), '', JText::_('COM_EASYSOCIAL_COMMENTS_REPORT_TEXT'), FRoute::external($comment->getPermalink()));
?>
</li>
<?php
}
?>
<?php
if ($this->access->allowed('comments.edit') || $isAuthor && $this->access->allowed('comments.editown')) {
?>
<li class="btn-comment-edit" data-comments-item-actions-edit>
<a href="javascript:void(0);"><?php
echo JText::_('COM_EASYSOCIAL_COMMENTS_ACTION_EDIT');
?>
</a>
</li>
示例3: onAfterCommentSave
public function onAfterCommentSave(&$comment)
{
// article.user.create
// article.user.update
// article.user.read
$allowed = array('article.user.create', 'article.user.update', 'article.user.read');
if (!in_array($comment->element, $allowed)) {
return;
}
$segments = $comment->element;
list($element, $group, $verb) = explode('.', $segments);
$streamItem = FD::table('streamitem');
$state = $streamItem->load(array('context_type' => $element, 'actor_type' => $group, 'verb' => $verb, 'context_id' => $comment->uid));
if (!$state) {
return;
}
$owner = $streamItem->actor_id;
$permalink = $comment->getPermalink();
$emailOptions = array('title' => 'APP_USER_ARTICLE_EMAILS_COMMENT_ITEM_TITLE', 'template' => 'apps/user/apps/comment.item', 'permalink' => FRoute::external($permalink));
$systemOptions = array('title' => '', 'content' => $comment->comment, 'context_type' => $comment->element, 'url' => $permalink, 'actor_id' => $comment->created_by, 'uid' => $comment->uid, 'aggregate' => true);
if ($comment->created_by != $owner) {
FD::notify('comments.item', array($owner), $emailOptions, $systemOptions);
}
$recipients = $this->getStreamNotificationTargets($comment->uid, $element, $group, $verb, array(), array($owner, $comment->created_by));
$emailOptions['title'] = 'APP_USER_ARTICLE_EMAILS_COMMENT_INVOLVED_TITLE';
$emailOptions['template'] = 'apps/user/apps/comment.involved';
FD::notify('comments.involved', $recipients, $emailOptions, $systemOptions);
}