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


PHP JDocument::setBase方法代码示例

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


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

示例1: testSetBase

	/**
	 * @todo Implement testSetBase().
	 */
	public function testSetBase() {
		$this->object = new JDocument;

		$this->object->setBase('http://www.example.com/base');

		$this->assertThat(
			$this->object->base,
			$this->equalTo('http://www.example.com/base')
		);
	}
开发者ID:realityking,项目名称:JAJAX,代码行数:13,代码来源:JDocumentTest.php

示例2: before

 protected function before()
 {
     KUNENA_PROFILER ? KunenaProfiler::instance()->start('function ' . get_class($this) . '::' . __FUNCTION__ . '()') : null;
     if (!$this->exists()) {
         KUNENA_PROFILER ? KunenaProfiler::instance()->stop('function ' . get_class($this) . '::' . __FUNCTION__ . '()') : null;
         throw new RuntimeException("Layout '{$this->input->getWord('view')}/{$this->input->getWord('layout', 'default')}' does not exist!", 404);
     }
     // Load language files.
     KunenaFactory::loadLanguage('com_kunena.sys', 'admin');
     KunenaFactory::loadLanguage('com_kunena.templates');
     KunenaFactory::loadLanguage('com_kunena.models');
     KunenaFactory::loadLanguage('com_kunena.views');
     $this->me = KunenaUserHelper::getMyself();
     $this->config = KunenaConfig::getInstance();
     $this->document = JFactory::getDocument();
     $this->template = KunenaFactory::getTemplate();
     $this->template->initialize();
     if ($this->me->isAdmin()) {
         // Display warnings to the administrator if forum is either offline or debug has been turned on.
         if ($this->config->board_offline) {
             $this->app->enqueueMessage(JText::_('COM_KUNENA_FORUM_IS_OFFLINE'), 'notice');
         }
         if ($this->config->debug) {
             $this->app->enqueueMessage(JText::_('COM_KUNENA_WARNING_DEBUG'), 'notice');
         }
     }
     if ($this->me->isBanned()) {
         // Display warnings to the banned users.
         $banned = KunenaUserBan::getInstanceByUserid($this->me->userid, true);
         if (!$banned->isLifetime()) {
             $this->app->enqueueMessage(JText::sprintf('COM_KUNENA_POST_ERROR_USER_BANNED_NOACCESS_EXPIRY', KunenaDate::getInstance($banned->expiration)->toKunena('date_today')), 'notice');
         } else {
             $this->app->enqueueMessage(JText::_('COM_KUNENA_POST_ERROR_USER_BANNED_NOACCESS'), 'notice');
         }
     }
     // Remove base and add canonical link.
     $this->document->setBase('');
     $this->document->addHeadLink(KunenaRoute::_(), 'canonical', 'rel', '');
     // Initialize breadcrumb.
     $this->breadcrumb = $this->app->getPathway();
     KUNENA_PROFILER ? KunenaProfiler::instance()->stop('function ' . get_class($this) . '::' . __FUNCTION__ . '()') : null;
 }
开发者ID:giabmf11,项目名称:Kunena-Forum,代码行数:42,代码来源:display.php

示例3: testEnsureSetBaseReturnsThisObject

 /**
  * @testdox  Test that setBase returns an instance of $this
  */
 public function testEnsureSetBaseReturnsThisObject()
 {
     $this->assertSame($this->object, $this->object->setBase('http://www.joomla.org'));
 }
开发者ID:n3t,项目名称:joomla-cms,代码行数:7,代码来源:JDocumentTest.php


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