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


PHP JURI::__toString方法代码示例

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


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

示例1: test__toString

	public function test__toString() {
		$this->object->parse('http://someuser:somepass@www.example.com:80/path/file.html?var=value#fragment');

		$this->assertThat(
			$this->object->__toString(),
			$this->equalTo('http://someuser:somepass@www.example.com:80/path/file.html?var=value#fragment')
		);
	}
开发者ID:realityking,项目名称:JAJAX,代码行数:8,代码来源:JURITest.php

示例2: __construct

 public function __construct($component, $componentParams, $article, $articleParams, $properties)
 {
     parent::__construct($component, $componentParams, $article, $articleParams);
     $this->print = isset($properties['print']) ? $properties['print'] : '';
     $this->pageHeading = $this->_componentParams->get('show_page_heading', 1) ? $this->_componentParams->get('page_heading') : '';
     $this->titleLink = $this->_articleParams->get('link_titles') && !empty($this->_article->readmore_link) ? $this->_article->readmore_link : '';
     $this->emailIconVisible = $this->emailIconVisible && !$this->print;
     $this->editIconVisible = $this->editIconVisible && !$this->print;
     $this->categoryLink = $this->_articleParams->get('link_category') && $this->_article->catslug ? JRoute::_(ContentHelperRoute::getCategoryRoute($this->_article->catslug)) : '';
     $this->category = $this->_articleParams->get('show_category') ? $this->_article->category_title : '';
     $this->categoryLink = $this->_articleParams->get('link_category') && $this->_article->catslug ? JRoute::_(ContentHelperRoute::getCategoryRoute($this->_article->catslug)) : '';
     $this->parentCategory = $this->_articleParams->get('show_parent_category') && $this->_article->parent_slug != '1:root' ? $this->_article->parent_title : '';
     $this->parentCategoryLink = $this->_articleParams->get('link_parent_category') && $this->_article->parent_slug ? JRoute::_(ContentHelperRoute::getCategoryRoute($this->_article->parent_slug)) : '';
     $this->author = $this->_articleParams->get('show_author') && !empty($this->_article->author) ? $this->_article->created_by_alias ? $this->_article->created_by_alias : $this->_article->author : '';
     if (strlen($this->author) && $this->_articleParams->get('link_author')) {
         $needle = 'index.php?option=com_contact&view=contact&id=' . $this->_article->contactid;
         $menu = JFactory::getApplication()->getMenu();
         $item = $menu->getItems('link', $needle, true);
         $this->authorLink = !empty($item) ? $needle . '&Itemid=' . $item->id : $needle;
     } else {
         $this->authorLink = '';
     }
     $this->toc = isset($this->_article->toc) ? $this->_article->toc : '';
     $this->text = $this->_articleParams->get('access-view') ? $this->_article->text : '';
     $user = JFactory::getUser();
     $this->introVisible = !$this->_articleParams->get('access-view') && $this->_articleParams->get('show_noauth') && $user->get('guest');
     $this->intro = $this->_article->introtext;
     if (!$this->_articleParams->get('access-view') && $this->_articleParams->get('show_noauth') && $user->get('guest') && $this->_articleParams->get('show_readmore') && $this->_article->fulltext != null) {
         $attribs = json_decode($this->_article->attribs);
         if ($attribs->alternative_readmore == null) {
             $this->readmore = JText::_('COM_CONTENT_REGISTER_TO_READ_MORE');
         } elseif ($this->readmore = $this->_article->alternative_readmore) {
             if ($this->_articleParams->get('show_readmore_title', 0) != 0) {
                 $this->readmore .= JHtml::_('string.truncate', $this->_article->title, $this->_articleParams->get('readmore_limit'));
             }
         } elseif ($this->_articleParams->get('show_readmore_title', 0) == 0) {
             $this->readmore = JText::sprintf('COM_CONTENT_READ_MORE_TITLE');
         } else {
             $this->readmore = JText::_('COM_CONTENT_READ_MORE') . JHtml::_('string.truncate', $this->_article->title, $this->_articleParams->get('readmore_limit'));
         }
         $link = new JURI(JRoute::_('index.php?option=com_users&view=login'));
         $this->readmoreLink = $link->__toString();
     } else {
         $this->readmore = '';
         $this->readmoreLink = '';
     }
     $this->paginationPosition = isset($this->_article->pagination) && $this->_article->pagination && isset($this->_article->paginationposition) ? ($this->_article->paginationposition ? 'below' : 'above') . ' ' . ($this->_article->paginationrelative ? 'full article' : 'text') : '';
     $this->showLinks = isset($this->_article->urls) && is_string($this->_article->urls) && !empty($this->_article->urls);
 }
开发者ID:sealse,项目名称:mondiale,代码行数:49,代码来源:SingleArticle.php

示例3: __construct

 protected function __construct($component, $componentParams, $article, $articleParams)
 {
     parent::__construct($component, $componentParams, $article, $articleParams);
     $this->isPublished = 0 != $this->_article->state;
     $this->titleLink = $this->_articleParams->get('link_titles') && $this->_articleParams->get('access-view') ? JRoute::_(ContentHelperRoute::getArticleRoute($this->_article->slug, $this->_article->catid)) : '';
     $this->intro = $this->_article->introtext;
     if ($this->_articleParams->get('show_readmore') && $this->_article->readmore) {
         if (!$this->_articleParams->get('access-view')) {
             $this->readmore = JText::_('COM_CONTENT_REGISTER_TO_READ_MORE');
         } elseif ($this->readmore = $this->_article->alternative_readmore) {
             if ($this->_articleParams->get('show_readmore_title', 0) != 0) {
                 $this->readmore .= JHtml::_('string.truncate', $this->_article->title, $this->_articleParams->get('readmore_limit'));
             }
         } elseif ($this->_articleParams->get('show_readmore_title', 0) == 0) {
             $this->readmore = JText::sprintf('COM_CONTENT_READ_MORE_TITLE');
         } else {
             $this->readmore = JText::_('COM_CONTENT_READ_MORE') . JHtml::_('string.truncate', $this->_article->title, $this->_articleParams->get('readmore_limit'));
         }
         if ($this->_articleParams->get('access-view')) {
             $link = JRoute::_(ContentHelperRoute::getArticleRoute($this->_article->slug, $this->_article->catid));
             $this->readmoreLink = $link;
         } else {
             $menu = JFactory::getApplication()->getMenu();
             $active = $menu->getActive();
             $itemId = $active->id;
             $link1 = JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId);
             $returnURL = JRoute::_(ContentHelperRoute::getArticleRoute($this->_article->slug, $this->_article->catid));
             $link = new JURI($link1);
             $link->setVar('return', base64_encode($returnURL));
             $this->readmoreLink = $link->__toString();
         }
     } else {
         $this->readmore = '';
         $this->readmoreLink = '';
     }
 }
开发者ID:randomNone1,项目名称:BiuWeb,代码行数:36,代码来源:ListItem.php


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