当前位置: 首页>>代码示例>>PHP>>正文


PHP FRoute::raw方法代码示例

本文整理汇总了PHP中FRoute::raw方法的典型用法代码示例。如果您正苦于以下问题:PHP FRoute::raw方法的具体用法?PHP FRoute::raw怎么用?PHP FRoute::raw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FRoute的用法示例。


在下文中一共展示了FRoute::raw方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getPreviewURI

 /**
  * Returns the php version of the source item.
  *
  * @since	1.0
  * @access	public
  * @param	null
  * @return 	string		The absolute URI for previewing an item.
  */
 public function getPreviewURI()
 {
     if ($this->storage != 'joomla') {
         $storage = FD::storage($this->storage);
         $path = $this->getStoragePath(true);
         $path = $path . '/' . $this->hash;
         return $storage->getPermalink($path);
     }
     // We need to fix the path for groups!
     $type = $this->type;
     if ($type == 'group') {
         $type = 'groups';
     }
     if ($type == 'event') {
         $type = 'events';
     }
     $uri = FRoute::raw('index.php?option=com_easysocial&view=' . $type . '&layout=preview&fileid=' . $this->id . '&tmpl=component');
     return $uri;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:27,代码来源:file.php

示例2: oauth

 /**
  * Displays the first step of user signing up with oauth
  *
  * @since	1.0
  * @access	public
  */
 public function oauth()
 {
     // If user is already logged in here, they shouldn't be allowed on this page.
     if (!$this->my->guest) {
         $this->setMessage(JText::_('COM_EASYSOCIAL_OAUTH_YOU_ARE_ALREADY_LOGGED_IN'), SOCIAL_MSG_ERROR);
         FD::info()->set($this->getMessage());
         $this->redirect(FRoute::dashboard(array(), false));
     }
     // Get allowed clients
     $allowedClients = array_keys((array) $this->config->get('oauth'));
     // Get the current client.
     $oauthClient = $this->input->get('client', '', 'word');
     if (!in_array($oauthClient, $allowedClients)) {
         FD::info()->set(false, JText::sprintf('COM_EASYSOCIAL_OAUTH_INVALID_OAUTH_CLIENT_PROVIDED', $oauthClient), SOCIAL_MSG_ERROR);
         return $this->redirect(FRoute::login(array(), false));
     }
     // Get the oauth client object.
     $client = FD::oauth($oauthClient);
     // Add page title
     $title = JText::sprintf('COM_EASYSOCIAL_OAUTH_PAGE_TITLE', ucfirst($oauthClient));
     $this->page->title($title);
     // Add breadcrumbs
     $this->page->breadcrumb($title);
     // Check configuration if the registration mode is set to simplified or normal.
     $registrationType = $this->config->get('oauth.' . $oauthClient . '.registration.type');
     if ($registrationType == 'simplified') {
         $createUrl = FRoute::raw('index.php?option=com_easysocial&controller=registration&task=oauthSignup&client=' . $oauthClient);
     } else {
         $createUrl = FRoute::registration(array('layout' => 'oauthSelectProfile', 'client' => $oauthClient));
     }
     // Check if import avatar option is enabled
     $importAvatar = $this->config->get('oauth.' . $oauthClient . '.registration.avatar');
     // Check if import cover option is enabled
     $importCover = $this->config->get('oauth.' . $oauthClient . '.registration.cover');
     // Get user's meta
     try {
         $meta = $client->getUserMeta();
     } catch (Exception $e) {
         $app = JFactory::getApplication();
         // Use dashboard here instead of login because api error calls might come from after user have successfully logged in
         $url = FRoute::dashboard(array(), false);
         $message = (object) array('message' => JText::sprintf('COM_EASYSOCIAL_OAUTH_FACEBOOK_ERROR_MESSAGE', $e->getMessage()), 'type' => SOCIAL_MSG_ERROR);
         FD::info()->set($message);
         $app->redirect($url);
         $app->close();
     }
     $this->set('meta', $meta);
     $this->set('createUrl', $createUrl);
     $this->set('clientType', $oauthClient);
     $this->set('importAvatar', $importAvatar);
     $this->set('importCover', $importCover);
     parent::display('site/registration/oauth');
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:59,代码来源:view.html.php


注:本文中的FRoute::raw方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。