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


PHP JHotelUtil::truncate方法代码示例

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


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

示例1:

        $offer->offer_description = $offer->offer_short_description;
        if (strlen($offer->offer_description) > 100) {
            echo JHotelUtil::truncate($offer->offer_description, 100, '…', true);
            ?>
										 
									<?php 
        } else {
            echo $offer->offer_description;
        }
        ?>
	 
								</div>
								<div>
								<?php 
        if (strlen($offer->offer_content) > 300) {
            echo JHotelUtil::truncate($offer->offer_content, 300, '&hellip;', true);
        } else {
            echo $offer->offer_content;
        }
        ?>
	 
								</div>
								<a href="<?php 
        echo JHotelUtil::getOfferLink($offer, $this->mediaReferer, $this->voucher);
        ?>
">  <?php 
        echo JText::_('LNG_READ_MORE', true);
        ?>
</a>
							</div>
							<div class="offer-date-interval splStayDate" style="display:none">
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:31,代码来源:default.php

示例2: setMarkers

        setMarkers(map, hotels);
      }

      /**
       * Data for the markers consisting of a name, a LatLng and a zIndex for
       * the order in which these markers should display on top of each
       * other.
       */
      var hotels = [
        <?php 
$db = JFactory::getDBO();
foreach ($hotels as $hotel) {
    $description = str_replace("\r\n", "", $hotel->hotelDescription);
    $description = str_replace("\\\\'", "", $description);
    $description = addslashes($description);
    $contentString = '<div id="map-content">' . '<h1 id="firstHeading" class="firstHeading">' . $db->escape($hotel->hotel_name) . '</h1>' . '<p>' . '<img src="' . JURI::root() . PATH_PICTURES . $hotel->hotel_picture_path . '" alt="' . $db->escape($hotel->hotel_name) . '">' . JHotelUtil::truncate(strip_tags($description), 180, ' &hellip; ', true) . '</p>' . '<p><a href="' . $db->escape(JHotelUtil::getHotelLink($hotel)) . '">' . JText::_('LNG_BOOK_HOTEL', true) . '</a></p>' . '</div>';
    echo "['" . $hotel->hotel_name . "', '" . $hotel->hotel_latitude . "','" . $hotel->hotel_longitude . "', 4,'" . $contentString . "']," . "\n";
}
?>
     	
      ];

      function setMarkers(map, locations) {
        // Add markers to the map

        // Marker sizes are expressed as a Size of X,Y
        // where the origin of the image (0,0) is located
        // in the top left of the image.

        // Origins, anchor positions and coordinates of the marker
        // increase in the X direction to the right and in
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:31,代码来源:hotel-map.php

示例3: round

									<?php 
            echo JText::_("LNG_DISTANCE") . ": " . round($hotel->distance, 1);
            ?>
 km
								</div>		
							<?php 
        }
        ?>
							
							<div class="clear"></div>
							<div class="hotel-description">
								<div>
								<?php 
        $hotelDescription = $hotel->hotel_description;
        if (strlen($hotelDescription) > MAX_LENGTH_HOTEL_DESCRIPTION) {
            echo JHotelUtil::truncate($hotelDescription, MAX_LENGTH_HOTEL_DESCRIPTION, '&hellip;', true);
            ?>
								<a href="<?php 
            echo JHotelUtil::getHotelLink($hotel);
            ?>
">  <?php 
            echo JText::_('LNG_READ_MORE', true);
            ?>
</a>
								<?php 
        } else {
            echo $hotelDescription;
        }
        ?>
	 
								</div>
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:31,代码来源:default(original).php

示例4: number_format

    echo $item->currency_symbol;
    ?>
&nbsp;</span><span class="fucsia price"> <?php 
    echo number_format($price, 2);
    ?>
</span></div>
					<a href="<?php 
    echo JHotelUtil::getHotelLink($item);
    ?>
"><?php 
    echo stripslashes($item->offer_name);
    ?>
</a>
					<p>
						<?php 
    echo JHotelUtil::truncate(strip_tags($item->offer_short_description), 250);
    ?>
					</p>
				</div>
				
			</li>
		<?php 
}
?>
	</ul>
	</div>
	<div class="view-all-offers clearfix">
		<a href="<?php 
echo JRoute::_('index.php?option=com_jhotelreservation&task=offers.searchOffers');
?>
"><?php 
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:31,代码来源:default.php


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