當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Helpers::truncateText方法代碼示例

本文整理匯總了PHP中Helpers::truncateText方法的典型用法代碼示例。如果您正苦於以下問題:PHP Helpers::truncateText方法的具體用法?PHP Helpers::truncateText怎麽用?PHP Helpers::truncateText使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Helpers的用法示例。


在下文中一共展示了Helpers::truncateText方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

<?php

$this->beginContent('application.modules_core.activity.views.activityLayout', array('activity' => $activity));
?>

<?php 
if ($workspace != null && Wall::$currentType != Wall::TYPE_SPACE) {
    ?>
    <?php 
    echo Yii::t('ActivityModule.views_activities_ActivitySpaceCreated', "%displayName% created the new space %spaceName%", array('%displayName%' => '<strong>' . $user->displayName . '</strong>', '%spaceName%' => '<strong>' . Helpers::truncateText($workspace->name, 25) . '</strong>'));
    ?>

<?php 
} else {
    ?>
    <?php 
    echo Yii::t('ActivityModule.views_activities_ActivitySpaceCreated', "%displayName% created this space.", array('%displayName%' => '<strong>' . $user->displayName . '</strong>'));
}
?>

<?php 
$this->endContent();
?>

開發者ID:ahdail,項目名稱:humhub,代碼行數:23,代碼來源:ActivitySpaceCreated.php

示例2: getContentTitle

 /**
  * Returns a title/text which identifies this IContent.
  * e.g. Post: foo bar 123...
  *
  * @return String
  */
 public function getContentTitle()
 {
     return Yii::t('CommentModule.models_comment', 'Comment') . " \"" . Helpers::truncateText($this->message, 40) . "\"";
 }
開發者ID:skapl,項目名稱:design,代碼行數:10,代碼來源:Comment.php

示例3: array

<?php

$this->beginContent('application.modules_core.activity.views.activityLayout', array('activity' => $activity));
?>

<?php 
if ($workspace != null && !Yii::app()->controller instanceof ContentContainerController) {
    ?>

<?php 
    if ($user->group_id == '2') {
        echo Yii::t('ActivityModule.views_activities_ActivitySpaceMemberAdded', "%displayName% joined the space %spaceName%", array('%displayName%' => '<strong>' . CHtml::encode($user->displayName) . '</strong>', '%spaceName%' => '<strong>' . CHtml::encode(Helpers::truncateText($workspace->name, 40)) . '</strong>'));
    } else {
        if ($user->group_id == '3') {
            echo Yii::t('ActivityModule.views_activities_ActivitySpaceMemberAdded', "%displayName% joined the space %spaceName%", array('%displayName%' => '<strong>' . CHtml::encode($user->profile->companyname . ' - ' . $user->displayName) . '</strong>', '%spaceName%' => '<strong>' . CHtml::encode(Helpers::truncateText($workspace->name, 40)) . '</strong>'));
        }
    }
    ?>

<?php 
} else {
    ?>
	
<?php 
    if ($user->group_id == '2') {
        echo Yii::t('ActivityModule.views_activities_ActivitySpaceMemberAdded', "%displayName% joined this space.", array('%displayName%' => '<strong>' . CHtml::encode($user->displayName) . '</strong>'));
    } else {
        if ($user->group_id == '3') {
            echo Yii::t('ActivityModule.views_activities_ActivitySpaceMemberAdded', "%displayName% joined this space.", array('%displayName%' => '<strong>' . CHtml::encode($user->profile->companyname . ' - ' . $user->displayName) . '</strong>'));
        }
    }
開發者ID:skapl,項目名稱:design,代碼行數:31,代碼來源:ActivitySpaceMemberAdded.php

示例4: getContentTitle

 /**
  * Returns a title/text which identifies this IContent.
  *
  * e.g. Post: foo bar 123...
  *
  * @return String
  */
 public function getContentTitle()
 {
     return Helpers::truncateText($this->post_title, 60);
 }
開發者ID:tejrajs,項目名稱:humhub-modules-questionanswer,代碼行數:11,代碼來源:Question.php

示例5: getContentTitle

 /**
  * Returns a title/text which identifies this IContent.
  * e.g. Post: foo bar 123...
  *
  * @return String
  */
 public function getContentTitle()
 {
     return "Comment \"" . Helpers::truncateText($this->message, 40) . "\"";
 }
開發者ID:ahdail,項目名稱:humhub,代碼行數:10,代碼來源:Comment.php

示例6:

    echo $space->getProfileImage()->getUrl();
    ?>
">
                <!-- Show space image, if you are outside from a space -->
                <div class="media-body">
                    <!-- Show content -->
                    <strong><?php 
    echo $space->name;
    ?>
</strong>

                    <div id="space-badge-<?php 
    echo $count;
    ?>
" class="badge badge-space pull-right" style="display:none;">0</div>
                    <br>
                    <p><?php 
    echo Helpers::truncateText($space->description, 60);
    ?>
</p>
                </div>
            </div>
        </a>
    </li>
    <?php 
    $count++;
}
?>


開發者ID:ahdail,項目名稱:humhub,代碼行數:28,代碼來源:index.php

示例7:

                    <b><?php 
echo $stats['answers'];
?>
</b>
                    <p>answers</p>
                </div>
            </div>

            <div class="media-body" style="padding-top:5px; padding-left:5px;">
                <div class="content">
                    <b><?php 
echo CHtml::link(CHtml::encode($question->post_title), $question::model()->getUrl(array('id' => $question->id)));
?>
</b><br />
                    <?php 
echo CHtml::encode(Helpers::truncateText($question->post_text, 250));
?>
                    <?php 
echo CHtml::link("read more <i class=\"fa fa-share\"></i>", $question::model()->getUrl(array('id' => $question->id)));
?>
                </div>
            </div>
        </div>

        <?php 
$this->endContent();
?>

    </div>
</div>
開發者ID:tejrajs,項目名稱:humhub-modules-questionanswer,代碼行數:30,代碼來源:entry.php

示例8: getContentTitle

 /**
  * Returns a title/text which identifies this IContent.
  * @return String
  */
 public function getContentTitle()
 {
     return Yii::t('LibraryModule.base', "Document") . " \"" . Helpers::truncateText($this->title, 25) . "\"";
 }
開發者ID:tejrajs,項目名稱:humhub-modules-library,代碼行數:8,代碼來源:LibraryDocument.php

示例9:

">

        <div class="media">
            <img class="media-object img-rounded pull-left"
                 src="<?php 
echo $target->getProfileImage()->getUrl();
?>
" width="50"
                 height="50" alt="50x50" data-src="holder.js/50x50" style="width: 50px; height: 50px;">

            <?php 
if ($target->status == Space::STATUS_ARCHIVED) {
    echo '<div class="archive_icon34"></div>';
}
?>

            <div class="media-body">
                <strong><?php 
echo $target->name;
?>
 </strong><br>

                <span class="content"><?php 
echo Helpers::truncateText($post->message, 200);
?>
</span>

            </div>
        </div>
    </a>
</li>
開發者ID:ahdail,項目名稱:humhub,代碼行數:31,代碼來源:searchResult.php

示例10: getWallTitle

 /**
  * Get wall title.
  */
 public function getWallTitle()
 {
     return 'album <b>' . Helpers::truncateText($this->name, 25) . '</b>';
 }
開發者ID:rafapaul,項目名稱:humhub-modules-album,代碼行數:7,代碼來源:Album.php

示例11: array

<?php

$this->beginContent('application.modules_core.activity.views.activityLayoutMail', array('activity' => $activity, 'showSpace' => false));
?>

<?php 
echo Yii::t('ActivityModule.views_activities_ActivitySpaceMemberAdded', "%displayName% joined the space %spaceName%", array('%displayName%' => '<strong>' . $user->displayName . '</strong>', '%spaceName%' => '<strong>' . Helpers::truncateText($workspace->name, 40) . '</strong>'));
?>
<br/>

<?php 
$this->endContent();
?>

開發者ID:ahdail,項目名稱:humhub,代碼行數:13,代碼來源:ActivitySpaceMemberAdded_mail.php

示例12: array

    ?>
</b>
                                <p>answers</p>
                            </div>

                        </div>

                        <div class="media-body" style="padding-top:5px; padding-left:10px;">
                            <h4 class="media-heading">
                                <?php 
    echo CHtml::link(CHtml::encode($question['post_title']), Yii::app()->createUrl('//questionanswer/main/view', array('id' => $question['id'])));
    ?>
                            </h4>

                            <h5><?php 
    echo CHtml::encode(Helpers::truncateText($question['post_text'], 200));
    ?>
</h5>
                        </div>
                    </div>
                <?php 
}
?>

                </div>
            </div>
        </div>

        <div class="col-md-3">
            <div class="panel panel-default">
                <div class="panel-heading"><strong>Related</strong> Questions</div>
開發者ID:tejrajs,項目名稱:humhub-modules-questionanswer,代碼行數:31,代碼來源:index.php

示例13: getContentTitle

 /**
  * Returns a title/text which identifies this IContent.
  *
  * e.g. Wiki: Page title...
  *
  * @return String
  */
 public function getContentTitle()
 {
     return Yii::t('WikiModule.models_WikiPage', "Wiki page") . " \"" . Helpers::truncateText($this->title, 25) . "\"";
 }
開發者ID:Wikom,項目名稱:humhub-modules-wiki,代碼行數:11,代碼來源:WikiPage.php

示例14:

?>
">
                <div class="profile-overlay-img profile-overlay-img-sm"></div>
            </span>
            
            <div class="media-body">
                <h4 class="media-heading"><?php 
echo CHtml::encode($message->getLastEntry()->user->displayName);
?>
 <small><?php 
echo HHtml::timeago($message->updated_at);
?>
</small></h4>
                <h5><?php 
print CHtml::encode(Helpers::truncateText($message->title, 75));
?>
</h5>
                <?php 
echo Helpers::truncateText(HMarkdownPreview::Render($message->getLastEntry()->content), 200);
?>
                <?php 
// show the new badge, if this message is still unread
if ($message->updated_at > $userMessage->last_viewed and $message->getLastEntry()->user->id != Yii::app()->user->id) {
    echo '<span class="label label-danger">' . Yii::t('MailModule.views_mail_index', 'New') . '</span>';
}
?>
            </div>
        </div>
    </a>
</li>
開發者ID:byronmejia,項目名稱:humhub-themes-tq,代碼行數:30,代碼來源:_messagePreview.php

示例15: array

<?php

$this->beginContent('application.modules_core.activity.views.activityLayout', array('activity' => $activity));
echo Yii::t('PollsModule.views_activities_PollCreated', '{userName} created a new {question}.', array('{userName}' => '<strong>' . $user->displayName . '</strong>', '{question}' => Helpers::truncateText($target['body'], 25)));
$this->endContent();
?>


開發者ID:nilBora,項目名稱:MVC_documents_Yii,代碼行數:6,代碼來源:DocumentCreated.php


注:本文中的Helpers::truncateText方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。