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


PHP SiteHelper::getStringForTitle方法代码示例

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


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

示例1: renderTags

 public function renderTags($slug)
 {
     if (Yii::app()->controller->beginCache($slug . "-page-" . Yii::app()->getLanguage(), array('duration' => 3600 * 24 * 3))) {
         $params = $this->tag_params;
         if (!empty($params[$slug])) {
             $paramArray = $params[$slug];
         } elseif (!empty($params["default"])) {
             $paramArray = $params["default"];
         }
         $listClass = array("key01", "key02", "key03", "key04", "key05", "key06");
         if (!empty($paramArray)) {
             $listTags = array();
             foreach ($paramArray as $key => $value) {
                 $modelClass = SiteHelper::getCamelCase($key);
                 $sql = "del=0";
                 if (!empty($value[2])) {
                     $sql .= " AND " . $value[2];
                 }
                 $link = SiteHelper::createUrl($value[0]);
                 $listItems = $modelClass::fetchAll(DBQueryParamsClass::CreateParams()->setConditions($sql)->setLimit($value[1])->setOrderBy("id DESC"));
                 foreach ($listItems as $item) {
                     if ($item->slug) {
                         $randClass = array_rand($listClass, 1);
                         $item->name = SiteHelper::getSubTextOnWorld($item->name, 60);
                         $listTags[] = '<a href="' . $link . "/" . $item->slug . '.html" title="' . SiteHelper::getStringForTitle($item->name) . '" class="' . $listClass[$randClass] . '">' . $item->name . '</a>';
                     }
                 }
             }
             shuffle($listTags);
             shuffle($listTags);
             foreach ($listTags as $key => $item) {
                 echo $item . " ";
             }
         }
         Yii::app()->controller->endCache();
     }
 }
开发者ID:bogiesoft,项目名称:yii-travel,代码行数:37,代码来源:PageInit.php

示例2:

    </div>
    <a href="<?php 
echo SiteHelper::createUrl("/tours/description") . "/" . $tour->slug;
?>
.html" title="<?php 
echo SiteHelper::getStringForTitle($tour->category_id->name . "," . $tour->name);
?>
"><?php 
echo SiteHelper::getSubTextOnWorld($tour->name, 100);
?>
</a><br/>
    <?php 
echo SiteHelper::getSubTextOnWorld($tour->description, 150);
?>
    <div class="LParams">
        <a href="<?php 
echo SiteHelper::createUrl("/travelAgency/description") . "/" . $tour->firm_id->slug;
?>
.html" title="<?php 
echo Yii::t("page", "туристическая фирма");
?>
 <?php 
echo SiteHelper::getStringForTitle($tour->firm_id->name);
?>
"><?php 
echo $tour->firm_id->name;
?>
</a>
    </div>
</div>
开发者ID:bogiesoft,项目名称:yii-travel,代码行数:30,代码来源:tour.php

示例3: foreach

<div class="row tourItems">
<?php 
foreach ($items as $item) {
    ?>
    <div class="panel panel-default">
        <div class="panel-heading">
            <a title="<?php 
    echo SiteHelper::getStringForTitle($item->name);
    ?>
" href="<?php 
    echo SiteHelper::createUrl("/resorts/description") . "/" . $item->slug;
    ?>
.html" href="<?php 
    echo SiteHelper::createUrl("/resorts/description") . "/" . $item->slug;
    ?>
.html"><?php 
    echo $item->name;
    ?>
</a>
        </div>
        <div class="panel-body">
            <div class="IImage img-rounded">
                <?php 
    echo ImageHelper::getAnimateImageBlock($item, SiteHelper::createUrl("/resorts/description") . "/" . $item->slug . ".html", $item->name . " - " . Yii::t("page", "курорты") . " " . $item->category_id->name2, 0);
    ?>
            </div>
            <div class="blockquote blockquoteOrange floatRight width200 height146">
                <?php 
    if ($item->price > 0) {
        echo Yii::t("page", "цена");
        ?>
开发者ID:bogiesoft,项目名称:yii-travel,代码行数:31,代码来源:catalog_resorts.php

示例4:

?>
                <?php 
if ($item->address) {
    echo $item->address;
}
?>
                <br/><br/>
            </p>
            <a class="OrderRequest LPLink" href="#" onclick="ajaxLogTour( 'hotels' ,<?php 
echo $item->id;
?>
, 'contact');yaCounter6154003.reachGoal('hotel_show_contact');return true;" title="<?php 
echo Yii::t("page", "Забронировать отель");
?>
 <?php 
echo SiteHelper::getStringForTitle($item->country_id->name);
?>
"><?php 
echo Yii::t("page", "забронировать");
?>
</a>
        </div>
        <div id="orderInfo" class="displayNone">
            <b><?php 
echo Yii::t("page", "отель");
?>
 - <?php 
echo $item->name;
?>
</b><br/>
            <p><?php 
开发者ID:bogiesoft,项目名称:yii-travel,代码行数:31,代码来源:description.php

示例5: foreach

<?php

$listNews = CatalogCid::fetchAll(DBQueryParamsClass::CreateParams()->setLimit(-1));
foreach ($listNews as $values) {
    ?>
    <div><a href="<?php 
    echo SiteHelper::createUrl("category/", array("slug" => $values->key_word));
    ?>
" title="<?php 
    echo SiteHelper::getStringForTitle($values->name);
    ?>
 : <?php 
    echo Yii::t("page", "Мировые новости, новости Узбекистана");
    ?>
"><?php 
    echo $values->name;
    ?>
</a></div>
    <div class="M_sep"></div>
<?php 
}
开发者ID:bogiesoft,项目名称:yii-travel,代码行数:21,代码来源:menu.php

示例6:

            <?php 
    if ($item->col > 0) {
        ?>
<div class="floatRight rightInfo"><?php 
        echo Yii::t("page", "просмотров");
        ?>
: <b><?php 
        echo $item->col;
        ?>
</b></div><?php 
    }
    ?>
        </div>
        <div class="panel-body">
            <div class="IImage img-rounded"><?php 
    echo ImageHelper::getAnimateImageBlock($item, SiteHelper::createUrl("/travelAgency/description") . "/" . $item->slug . ".html", "туристическое агенство " . (!empty($item->country_id) ? $item->country_id->name2 : "") . " - " . SiteHelper::getStringForTitle($item->name), 0);
    ?>
</div>
            <div class="blockquote blockquoteOrange floatRight">
                <?php 
    if ($item->price > 0) {
        echo Yii::t("page", "цена");
        ?>
: <b class="radColor"><?php 
        echo $item->price;
        ?>
</b><br/><?php 
    }
    ?>
                <?php 
    if (!empty($item->country_id)) {
开发者ID:bogiesoft,项目名称:yii-travel,代码行数:31,代码来源:catalog_firms.php


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