當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。