當前位置: 首頁>>代碼示例>>PHP>>正文


PHP URLHelper::setBaseURL方法代碼示例

本文整理匯總了PHP中URLHelper::setBaseURL方法的典型用法代碼示例。如果您正苦於以下問題:PHP URLHelper::setBaseURL方法的具體用法?PHP URLHelper::setBaseURL怎麽用?PHP URLHelper::setBaseURL使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在URLHelper的用法示例。


在下文中一共展示了URLHelper::setBaseURL方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: absolute_url_for

 public function absolute_url_for($to)
 {
     $old_base = URLHelper::setBaseURL($GLOBALS['ABSOLUTE_URI_STUDIP']);
     $args = func_get_args();
     $url = call_user_func_array(array($this, 'url_for'), $args);
     URLHelper::setBaseURL($old_base);
     return $url;
 }
開發者ID:studip,項目名稱:PluginMarket,代碼行數:8,代碼來源:market_controller.php

示例2: getURL

 public function getURL($absolute_url = false)
 {
     if ($absolute_url) {
         $old_base = URLHelper::setBaseURL($GLOBALS['ABSOLUTE_URI_STUDIP']);
     }
     $url = URLHelper::getURL("plugins.php/pluginmarket/presenting/image/" . $this->getId(), array(), true);
     if ($absolute_url) {
         URLHelper::setBaseURL($old_base);
     }
     return $url;
 }
開發者ID:studip,項目名稱:PluginMarket,代碼行數:11,代碼來源:MarketImage.class.php

示例3: ob_start

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
// +---------------------------------------------------------------------------+
ob_start();
require '../lib/bootstrap.php';
page_open(array("sess" => "Seminar_Session", "auth" => "Seminar_Default_Auth", "perm" => "Seminar_Perm", "user" => "Seminar_User"));
require_once 'lib/datei.inc.php';
//basename() needs setlocale()
init_i18n($_SESSION['_language']);
// Set Base URL, otherwise links will fail on SENDFILE_LINK_MODE = rewrite
URLHelper::setBaseURL($GLOBALS['ABSOLUTE_URI_STUDIP']);
$file_id = escapeshellcmd(basename(Request::get('file_id')));
$type = Request::int('type');
if ($type < 0 || $type > 7) {
    $type = 0;
}
$document = new StudipDocument($file_id);
$object_id = $document->getValue('seminar_id');
$no_access = true;
//download from course or institute or document is a message attachement
if ($object_id && in_array($type, array(0, 6, 7))) {
    $no_access = !$document->checkAccess($GLOBALS['user']->id);
}
//download from archive, allowed if former participant
if ($type == 1) {
    $query = "SELECT seminar_id FROM archiv WHERE archiv_file_id = ?";
開發者ID:ratbird,項目名稱:hope,代碼行數:31,代碼來源:sendfile.php

示例4: testSetBaseURL

 public function testSetBaseURL()
 {
     $this->assertEquals('foo/bar', URLHelper::getLink('foo/bar'));
     $this->assertEquals('/foo/bar', URLHelper::getLink('/foo/bar'));
     $this->assertEquals('http://www.studip.de/foo/bar', URLHelper::getLink('http://www.studip.de/foo/bar'));
     URLHelper::setBaseURL('/dir/');
     $this->assertEquals('/dir/foo/bar', URLHelper::getLink('foo/bar'));
     $this->assertEquals('/foo/bar', URLHelper::getLink('/foo/bar'));
     $this->assertEquals('http://www.studip.de/foo/bar', URLHelper::getLink('http://www.studip.de/foo/bar'));
     URLHelper::setBaseURL('http://cnn.com/test/');
     $this->assertEquals('http://cnn.com/test/foo/bar', URLHelper::getLink('foo/bar'));
     $this->assertEquals('http://cnn.com/foo/bar', URLHelper::getLink('/foo/bar'));
     $this->assertEquals('http://www.studip.de/foo/bar', URLHelper::getLink('http://www.studip.de/foo/bar'));
 }
開發者ID:ratbird,項目名稱:hope,代碼行數:14,代碼來源:UrlHelperTest.php

示例5: getDownloadLink

 public function getDownloadLink($inline = false, $absolute = false)
 {
     if ($absolute) {
         $old_base_url = URLHelper::setBaseURL($GLOBALS['ABSOLUTE_URI_STUDIP']);
     }
     $url = $inline ? URLHelper::getURL('dispatch.php/document/download/' . $this->id . '/inline', array(), true) : URLHelper::getURL('dispatch.php/document/download/' . $this->id, array(), true);
     if ($absolute) {
         URLHelper::setBaseURL($old_base_url);
     }
     return $url;
 }
開發者ID:ratbird,項目名稱:hope,代碼行數:11,代碼來源:DirectoryEntry.php

示例6: getPluginText

 function getPluginText($plugin, $range_id, $r_data, $m_name)
 {
     $base_url = URLHelper::setBaseURL('');
     $nav = $plugin->getIconNavigation($range_id, $r_data['visitdate'], $GLOBALS['user']->id);
     UrlHelper::setBaseURl($base_url);
     if ($nav instanceof Navigation && $nav->isVisible(true)) {
         if ($nav->getBadgeNumber()) {
             $url = 'seminar_main.php?again=yes&auswahl=' . $range_id . '&redirect_to=' . strtr($nav->getURL(), '?', '&');
             $icon = $nav->getImage();
             $tab = array_pop($plugin->getTabNavigation());
             if ($tab instanceof Navigation && $tab->isVisible()) {
                 $text = $tab->getTitle();
             }
             if (!$text) {
                 $text = $this->registered_modules[$m_name]['name'];
             }
             if ($nav->getBadgeNumber() == 1) {
                 $text .= ' - ' . _("Ein neuer Beitrag:");
             } else {
                 $text .= ' - ' . sprintf(_("%s neue Beiträge:"), $nav->getBadgeNumber());
             }
             return compact('text', 'url', 'icon', 'range_id');
         } else {
             return null;
         }
     }
 }
開發者ID:ratbird,項目名稱:hope,代碼行數:27,代碼來源:ModulesNotification.class.php


注:本文中的URLHelper::setBaseURL方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。