本文整理汇总了PHP中R::Url方法的典型用法代码示例。如果您正苦于以下问题:PHP R::Url方法的具体用法?PHP R::Url怎么用?PHP R::Url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类R
的用法示例。
在下文中一共展示了R::Url方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: hook_meta
/**
* Meta hook
*
* @return void
*/
public function hook_meta()
{
$sAction = Router::GetAction();
$sUrl = E::ModuleSeopack()->ClearUrl(R::Url('path'));
$oSeopack = E::ModuleSeopack()->GetSeopackByUrl($sUrl);
E::ModuleViewer()->Assign('sCurrentUrl', $sUrl);
if ($oSeopack) {
E::ModuleViewer()->Assign('oSeopack', $oSeopack);
}
$sMetaDescriptionTemplate = Plugin::GetTemplateDir(__CLASS__) . 'tpls/meta/description/' . $sAction . '.tpl';
if (E::ModuleViewer()->TemplateExists($sMetaDescriptionTemplate)) {
$sMetaDescription = E::ModuleViewer()->Fetch($sMetaDescriptionTemplate);
if ($oSeopack && $oSeopack->getDescription()) {
E::ModuleViewer()->Assign('sHtmlDescription', htmlspecialchars($oSeopack->getDescription()));
} else {
E::ModuleViewer()->Assign('sHtmlDescription', htmlspecialchars($sMetaDescription));
}
}
$sMetaKeywordsTemplate = Plugin::GetTemplateDir(__CLASS__) . 'tpls/meta/keywords/' . $sAction . '.tpl';
if (E::ModuleViewer()->TemplateExists($sMetaKeywordsTemplate)) {
$sMetaKeywords = E::ModuleViewer()->Fetch($sMetaKeywordsTemplate);
if ($oSeopack && $oSeopack->getKeywords()) {
E::ModuleViewer()->Assign('sHtmlKeywords', htmlspecialchars($oSeopack->getKeywords()));
} else {
E::ModuleViewer()->Assign('sHtmlKeywords', htmlspecialchars($sMetaKeywords));
}
}
if ($oSeopack && $oSeopack->getTitle()) {
E::ModuleViewer()->Assign('sHtmlTitle', htmlspecialchars($oSeopack->getTitle()));
}
}
示例2: EventTags
/**
* Отображение топиков
*
*/
protected function EventTags()
{
// * Gets tag from URL
$sTag = F::UrlDecode(R::Url('event'), true);
// * Check page number
$iPage = $this->GetParamEventMatch(0, 2) ? $this->GetParamEventMatch(0, 2) : 1;
// * Gets topics list
$aResult = E::ModuleTopic()->GetTopicsByTag($sTag, $iPage, Config::Get('module.topic.per_page'));
$aTopics = $aResult['collection'];
// * Calls hooks
E::ModuleHook()->Run('topics_list_show', array('aTopics' => $aTopics));
// * Makes pages
$aPaging = E::ModuleViewer()->MakePaging($aResult['count'], $iPage, Config::Get('module.topic.per_page'), Config::Get('pagination.pages.count'), R::GetPath('tag') . htmlspecialchars($sTag));
// * Loads variables to template
E::ModuleViewer()->Assign('aPaging', $aPaging);
E::ModuleViewer()->Assign('aTopics', $aTopics);
E::ModuleViewer()->Assign('sTag', $sTag);
E::ModuleViewer()->AddHtmlTitle(E::ModuleLang()->Get('tag_title'));
E::ModuleViewer()->AddHtmlTitle($sTag);
E::ModuleViewer()->SetHtmlRssAlternate(R::GetPath('rss') . 'tag/' . $sTag . '/', $sTag);
// * Sets template for display
$this->SetTemplateAction('index');
}
示例3: SetHtmlHeadFiles
/**
* Устанавливает список файлов для вывода в хидере страницы
*
* @param array $aText Список файлов
*/
public function SetHtmlHeadFiles($aText)
{
$aCfg = array('url' => array('root' => Config::Get('path.root.url'), 'ajax' => R::Url('base')), 'assets' => E::ModuleViewerAsset()->GetPreparedAssetLinks(), 'lang' => Config::Get('lang.current'), 'wysiwyg' => Config::Get('view.wysiwyg') ? true : false);
$sScript = 'var ls = ls || { };' . PHP_EOL;
$sScript .= 'ls.cfg = ' . F::JsonEncode($aCfg) . ';' . PHP_EOL;
$sScript = '<script>' . $sScript . '</script>' . PHP_EOL;
if (isset($aText['js'])) {
$aText['js'] = $sScript . $aText['js'];
} else {
$aText['js'] = $sScript;
}
$this->aHtmlHeadFiles = $aText;
}
示例4: Shutdown
/**
* Завершаем работу модуля
*
*/
public function Shutdown()
{
// * Делаем выгрузку необходимых текстовок в шаблон в виде js
$this->AssignToJs();
if (Config::Get('lang.multilang')) {
E::ModuleViewer()->AddHtmlHeadTag('<link rel="alternate" hreflang="x-default" href="' . R::Url('link') . '">');
$aLangs = Config::Get('lang.allow');
foreach ($aLangs as $sLang) {
E::ModuleViewer()->AddHtmlHeadTag('<link rel="alternate" hreflang="' . $sLang . '" href="' . trim(F::File_RootUrl($sLang), '/') . R::Url('path') . '">');
}
}
}
示例5: _showRssItems
/**
* Create and show rss channel
*
* @param $aItems
*/
protected function _showRssItems($aItems)
{
$aParts = explode('/', trim(R::Url('path'), '/'), 2);
if (isset($aParts[1])) {
$sLink = R::GetPath('/' . $aParts[1]);
} else {
$sLink = R::GetPath('/');
}
if ($sQuery = R::Url('query')) {
$sLink .= '?' . $sQuery;
}
$aRssChannelData = array('title' => E::ModuleViewer()->GetHtmlTitle(), 'description' => E::ModuleViewer()->GetHtmlDescription(), 'link' => $sLink, 'language' => C::Get('lang.current'), 'managing_editor' => C::Get('general.rss_editor_mail'), 'web_master' => C::Get('general.rss_editor_mail'), 'generator' => 'Alto CMS v.' . ALTO_VERSION);
/** @var ModuleRss_EntityRssChannel $oRssChannel */
$oRssChannel = E::GetEntity('ModuleRss_EntityRssChannel', $aRssChannelData);
/** @var ModuleRss_EntityRss $oRss */
$oRss = E::GetEntity('Rss');
if ($aItems) {
// Adds items into RSS channel
foreach ($aItems as $oItem) {
if ($oItem) {
$oRssChannel->AddItem($oItem->CreateRssItem());
}
}
}
$oRss->AddChannel($oRssChannel);
$this->_displayRss($oRss);
}