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


PHP SiteHelper::getSubTextOnWorld方法代码示例

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


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

示例1: actionIndex

 /**
  * This is the default 'index' action that is invoked
  * when an action is not explicitly requested by users.
  */
 public function actionIndex()
 {
     Yii::app()->page->title = "Каталог продукции";
     if (!Yii::app()->user->isGuest) {
         $itemModel = new CatalogItemsAdd();
         if (!empty($_POST["save_profile"])) {
             $itemModel->setAttributesFromArray($_POST["CatalogItemsAdd"]);
             $itemModel->user_id = Yii::app()->user->id;
             $itemModel->status_id = 3;
             // По умолчанию не активен
             $itemModel->date = time();
             if ($itemModel->saveParam()) {
                 $itemModel->onAddItem(new CModelEvent($itemModel), array("id" => $itemModel->id, "subject" => $itemModel->name, "date" => date("d.m.Y"), "description" => SiteHelper::getSubTextOnWorld($itemModel->description, 200), "link" => Yii::app()->params["adminEmail"] . SiteHelper::createUrl("/user/items/description/", array("id" => $itemModel->id))));
                 $this->redirect(SiteHelper::createUrl("/catalog/add/save", array("id" => $itemModel->id)));
             }
         }
         $addDopParams = null;
         if ($itemModel->category_id && $itemModel->category_id->id > 0) {
             $categoryModel = CatalogItemsCategory::fetch($itemModel->category_id->id);
             if ($categoryModel->table_name) {
                 $catalogClass = SiteHelper::getCamelCase($categoryModel->table_name);
                 $addDopParams = new $catalogClass();
             }
         }
         $this->render("add", array("form" => $itemModel, "addDopParams" => $addDopParams));
     } else {
         Yii::app()->session['redirect'] = SiteHelper::createUrl("/catalog/add");
         $this->render("addauthWidget");
     }
 }
开发者ID:bogiesoft,项目名称:yii-travel,代码行数:34,代码来源:AddController.php

示例2: 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

示例3:

        <?php 
}
?>
    </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>
开发者ID:bogiesoft,项目名称:yii-travel,代码行数:31,代码来源:tour.php

示例4: array

    echo $service->id;
    ?>
</td>
            <td>
                <a href="<?php 
    echo SiteHelper::createUrl("/user/firmComments/description", array("id" => $service->id, "fid" => $item->id));
    ?>
" title="<?php 
    echo Yii::t("page", "Описание акции/скидки");
    ?>
"><?php 
    echo $service->name;
    ?>
</a><br/>
                <?php 
    echo SiteHelper::getSubTextOnWorld($service->description, 550);
    ?>
                <br/><br/>
            </td>
            <td class="textAlignCenter"><?php 
    echo SiteHelper::getDateOnFormat($service->date, "d.m.Y H:i");
    ?>
</td>
            <td class="textAlignCenter"><?php 
    echo $service->is_new == 1 ? "<div class=\"readNew\">новое<br/></div>" : "";
    ?>
<div class="publishStatus"><?php 
    echo $service->active == 1 ? Yii::t("user", "опубликовано") : Yii::t("user", "не Опубликовано");
    ?>
</div></td>
            <td class="textAlignCenter">
开发者ID:bogiesoft,项目名称:yii-travel,代码行数:31,代码来源:pcomments_page.php

示例5: array

"><?php 
    echo $item->name;
    ?>
</a><br/>
                <div class="IBPrice"><?php 
    if ($item->price > 0) {
        ?>
<div class="IBPrice2"><font>$</font><b><?php 
        echo $item->price;
        ?>
</b><div class="itemRightBG"></div></div><?php 
    }
    ?>
</div>
                <div class="IBDesc"><?php 
    echo SiteHelper::getSubTextOnWorld($item->description, 140);
    ?>
</div>
                <div class="redLink"><a href="<?php 
    echo SiteHelper::createUrl("/user/favorites", array("del" => $item->id));
    ?>
"><?php 
    echo Yii::t("user", "удалить");
    ?>
</a></div>
            </div>
        <?php 
}
?>
        <?php 
if (sizeof($items) == 0) {
开发者ID:bogiesoft,项目名称:yii-travel,代码行数:31,代码来源:index.php

示例6:

    if ($step == 2) {
        ?>
<a href="<?php 
        echo $link . "/" . $item->slug;
        ?>
.html" title="<?php 
        echo $item->name;
        ?>
" class="ILIHed"><?php 
        echo $item->name;
        ?>
</a><?php 
    }
    ?>
            <?php 
    echo $step == 3 ? SiteHelper::getSubTextOnWorld($item->description, 100) : "";
    ?>
        </div>
    <?php 
}
?>
    <a title="<?php 
echo Yii::t("page", "остальные");
?>
" class="mLinks" href="<?php 
echo $linkAll;
?>
"><?php 
echo Yii::t("page", "остальные");
?>
 ...</a>
开发者ID:bogiesoft,项目名称:yii-travel,代码行数:31,代码来源:infoWidget.php

示例7:

    echo ImageHelper::getAnimateImageBlock($firmItem, SiteHelper::createUrl("/touristInfo/description") . "/" . $firmItem->slug . ".html");
    ?>
            </td>
            <td class="textAlignJustify">
                <a href="<?php 
    echo SiteHelper::createUrl("/touristInfo/description") . "/" . $firmItem->slug;
    ?>
.html" title="<?php 
    echo Yii::t("page", "описание туристического предложения");
    ?>
"><?php 
    echo $firmItem->name;
    ?>
</a><br/>
                <?php 
    echo SiteHelper::getSubTextOnWorld($firmItem->description, 300);
    ?>
                <div class="itemAction textAlignRight">
                    <a href="<?php 
    echo SiteHelper::createUrl("/touristInfo/category") . "/" . $firmItem->category_id->slug;
    ?>
.html"><?php 
    echo $firmItem->category_id->name;
    ?>
</a><br/>
                    <a href="<?php 
    echo SiteHelper::createUrl("/touristInfo/description") . "/" . $firmItem->slug;
    ?>
.html"><?php 
    echo Yii::t("page", "Описание");
    ?>
开发者ID:bogiesoft,项目名称:yii-travel,代码行数:31,代码来源:info.php

示例8: array

    ?>
            <?php 
    if ($step == 2) {
        ?>
<a href="<?php 
        echo SiteHelper::createUrl("/info/description", array("id" => $item->id));
        ?>
" title="<?php 
        echo $item->name;
        ?>
" class="ILIHed"><?php 
        echo $item->name;
        ?>
</a><?php 
    }
    ?>
            <?php 
    echo $step == 2 ? SiteHelper::getSubTextOnWorld($item->name, 200) : "";
    ?>
            <?php 
    echo $step == 3 ? SiteHelper::getSubTextOnWorld($item->name, 100) : "";
    ?>
        </div>
    <?php 
}
?>
    <a title="остальные" class="mLinks" href="info/"><?php 
echo Yii::t("page", "остальные");
?>
 ...</a>
</div>
开发者ID:bogiesoft,项目名称:yii-travel,代码行数:31,代码来源:curorts.php

示例9:

                    echo $item2->name;
                    ?>
" /><?php 
                }
                ?>
                            <?php 
                if ($item2->price > 0) {
                    ?>
Стоимость: <b><?php 
                    echo $item2->price;
                    ?>
$</b><br/><?php 
                }
                ?>
                            <?php 
                echo SiteHelper::getSubTextOnWorld($item2->description, 400);
                ?>
                            <div class="textAlignRight">
                                <a class="cMore" href="<?php 
                echo SiteHelper::createUrl("/tours/description") . "/" . $item2->slug;
                ?>
.html" title="<?php 
                echo $item2->name;
                ?>
"><?php 
                echo Yii::t("page", "читать подробнее");
                ?>
</a>
                            </div>
                        </div>
                    </li>
开发者ID:bogiesoft,项目名称:yii-travel,代码行数:31,代码来源:index.php

示例10:

.html" title="<?php 
            echo $line["name"];
            ?>
"><?php 
            echo $line["name"];
            ?>
</a></span>
                <div class="displayNone">
                    <div class="LTText"><a href="<?php 
            echo SiteHelper::createUrl("/" . $link . "/description") . "/" . $line["slug"];
            ?>
.html" title="<?php 
            echo $line["name"];
            ?>
"><?php 
            echo SiteHelper::getSubTextOnWorld($line["description"], 600);
            ?>
</a></div>
                    <div class="textAlignRight"><a href="<?php 
            echo SiteHelper::createUrl("/" . $link . "/description") . "/" . $line["slug"];
            ?>
.html" title="<?php 
            echo $line["name"];
            ?>
">подробнее >>></a></div>
                </div>
            </div>
        </div>
    <?php 
        }
        ?>
开发者ID:bogiesoft,项目名称:yii-travel,代码行数:31,代码来源:error.php

示例11: actionShow


//.........这里部分代码省略.........
                 $tours = CatalogTours::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("country_id=:cid AND id !=:id AND active=1")->setParams([":cid" => $countryModel->id, ":id" => $toursMinPrice[0]->id])->setLimit(7)->setOrderBy("rating DESC, price"));
                 $tours[] = $toursMinPrice[0];
                 $info = CatalogInfo::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("country_id=:cid")->setParams([":cid" => $countryModel->id])->setLimit(4)->setOrderBy("id DESC"));
                 $subject = $countryModel->title . ", от " . $tours[sizeof($tours) - 1]->price . ($tours[sizeof($tours) - 1]->currency_id->id ? $tours[sizeof($tours) - 1]->currency_id->title : "\$");
             } else {
                 $params = [":cid" => $categoryModel->id];
                 $condition = "category_id=:cid";
                 if ($locat == "uzb") {
                     echo $locat . "==uzb<br/>";
                     $params = array_merge($params, [":country" => 1]);
                     $condition .= " AND country_id!=:country";
                 } else {
                     $params = array_merge($params, [":country" => 1]);
                     $condition .= " AND country_id=:country";
                 }
                 echo $condition . "*";
                 $toursMinPrice = CatalogTours::fetchAll(DBQueryParamsClass::CreateParams()->setConditions($condition)->setParams($params)->setOrderBy("price")->setLimit(1)->setCache(0));
                 $tours = CatalogTours::fetchAll(DBQueryParamsClass::CreateParams()->setConditions($condition . " AND id !=:id")->setParams(array_merge($params, [":id" => $toursMinPrice[0]->id]))->setLimit(7)->setOrderBy("rating DESC, price"));
                 $tours[] = $toursMinPrice[0];
                 //$info = CatalogInfo::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("country_id=:cid")->setParams([":cid" => $categoryModel->id])->setLimit(4)->setOrderBy("id DESC"));
                 if ($tours[sizeof($tours) - 1]->price > 0) {
                     $subject = "Тур - " . $categoryModel->name . ", от " . $tours[sizeof($tours) - 1]->price . ($tours[sizeof($tours) - 1]->currency_id->id ? $tours[sizeof($tours) - 1]->currency_id->title : "\$");
                 } else {
                     $subject = "Тур - " . $categoryModel->name;
                 }
             }
             $message = "Предлагаем Вашему вниманию интересную подборку с нашего портала <a href=\"http://www.world-travel.uz\">World-Travel.uz</a>.<br/><br/><h1>" . $subject . "</h1><br/><table>";
             $n = 0;
             $reserveNum = 0;
             $reserveList = [];
             foreach ($tours as $tour) {
                 if ($tour->id == 0) {
                     continue;
                 }
                 $image = ImageHelper::getImages($tour, 1);
                 // Если картинки для тура нету, то берем её из резерва catalog_image_reserve
                 if (sizeof($image) == 0) {
                     if (sizeof($reserveList) == 0) {
                         $reserveList = CatalogImageReserve::findByAttributes(["country_id" => $tour->country_id->id]);
                     }
                     if (sizeof($reserveList) > 0) {
                         $new = new CatGallery();
                         if (!empty($reserveList[$reserveNum])) {
                             $new->image = $reserveList[$reserveNum]->image;
                         } else {
                             if ($tour->country_id->banner) {
                                 $new->image = $tour->country_id->banner;
                             } else {
                                 $new->image = $tour->country_id->image;
                             }
                         }
                         $image[] = $new;
                         $reserveNum++;
                     }
                 }
                 if ($n == 0 || $n == 2 || $n == 4 || $n == 6) {
                     $message .= "<tr>";
                 }
                 $message .= "<td style=\"width:50%;text-align:center;vertical-align: top;background-color: #EEE9DD;padding: 10px;border: 1px solid #fff;\">\n                            <table width=\"100%\">\n                                <tr>\n                                    <td style=\"background:#E4DDCD;font-size:13px;text-align: right;padding-right: 5px;vertical-align: middle;\"><b>" . $tour->name . "</b></td>";
                 if ($tour->price > 0) {
                     $message .= "<td style=\"background:#E4DDCD;vertical-align: top;line-height: 14px;text-align: center;\"><span style=\"font-size:10px;\">от</span><br/><b style=\"color:#ff4f00;font-size:24px;\"> " . $tour->price . ($tour->currency_id->id ? $tour->currency_id->title : "\$") . "</b><br/></td>";
                 }
                 $message .= "</tr>\n                            </table>";
                 if (sizeof($image) > 0) {
                     $message .= "<div style=\"max-height: 134px;overflow: hidden;\"><img src=\"" . (SiteHelper::createUrl("/") . ImageHelper::getImage($image[0]->image, 2)) . "\" style=\"max-width:200px\"/></div>";
                 }
                 //if( $tour->included )$message .= "<td>Включенно: ".$tour->included."</td></tr>";
                 if ($tour->duration) {
                     $message .= $tour->duration . "<br/>";
                 }
                 if ($tour->category_id->id > 0) {
                     $message .= "Тур - " . $tour->category_id->name2 . "<br/>";
                 }
                 $message .= "<div><a style=\"margin-top: 11px;background:#ff4f00;color:#fff;font-weight: bold;display: inline-block;padding: 5px 10px;border-radius: 4px;\" href=\"" . SiteHelper::createUrl("/tours/description") . "/" . $tour->slug . ".html\">Заказать</a></div></td>";
                 //
                 if ($n == 1 || $n == 3 || $n == 5 || $n == 7) {
                     $message .= "</tr>";
                 }
                 $n++;
             }
             $message .= '</table></div><br/>';
             if (sizeof($info) > 0) {
                 $message .= '<div style="background: #e4ddcd;padding: 0px 10px 10px 10px;overflow: hidden;"><table>';
                 foreach ($info as $item) {
                     $message .= "<tr><td colspan=\"2\"><h3 style=\"margin:10px 0px 5px 0px;\">" . $item->name . "</h3></td></tr>\n                                     <tr>\n                                        <td colspan=\"2\" style=\"border-bottom:1px solid #F4F1EA;padding-bottom:10px;\">\n                                            <table width=\"100%\">\n                                                <tr>\n                                                    <td><img src=\"" . SiteHelper::createUrl("/") . ImageHelper::getImage($item->image, 2) . "\" style=\"padding-right: 10px;\" alt=\"" . $item->name . "\" /></td>\n                                                    <td style=\"text-align: justify;vertical-align:top\">" . SiteHelper::getSubTextOnWorld($item->description, 350) . "<br/><div align=\"right\"><a href=\"" . SiteHelper::createUrl("/touristInfo/description") . $item->slug . ".html\">читайте подробнее >>></a></div></td>\n                                                </tr>\n                                            </table>\n                                        </td>\n                                     </tr>";
                     //
                 }
                 $message .= "</table></div>";
             }
             $cout .= $message . "</body></html>";
             //if( SubscribesUzHelper::sendEmails( array( 7, 35, 41 ), $subject, $message, 3 ) )echo "Ура отправил";
             //                                                                        else echo "Что-то пошло не так";
         }
     }
     if ($return) {
         return $cout;
     } else {
         echo $cout;
     }
 }
开发者ID:bogiesoft,项目名称:yii-travel,代码行数:101,代码来源:SubscribeTableController.php

示例12:

>
            <td>#<?php 
    echo $comment->id;
    ?>
<br/><?php 
    echo SiteHelper::getDateOnFormat($comment->date, "d.m.Y");
    ?>
</td>
            <td class="textAlignJustify">
                <a href="#" class="commentHref" title=""><?php 
    echo $comment->name;
    ?>
</a><br/>
                <div class="commentLText">
                    <?php 
    echo SiteHelper::getSubTextOnWorld($comment->description, 400);
    ?>
                </div>
                <div class="commentText overflowHidden displayNone">
                    <?php 
    echo $comment->description;
    ?>
                </div>
                <div class="itemAction textAlignRight">
                    <a href="#" class="commentHref"><?php 
    echo Yii::t("page", "Описание");
    ?>
</a><br/>
                </div>
            </td>
        </tr>
开发者ID:bogiesoft,项目名称:yii-travel,代码行数:31,代码来源:pcomemts_page.php


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