本文整理汇总了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();
?>
示例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) . "\"";
}
示例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>'));
}
}
示例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);
}
示例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) . "\"";
}
示例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++;
}
?>
示例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>
示例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) . "\"";
}
示例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>
示例10: getWallTitle
/**
* Get wall title.
*/
public function getWallTitle()
{
return 'album <b>' . Helpers::truncateText($this->name, 25) . '</b>';
}
示例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();
?>
示例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>
示例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) . "\"";
}
示例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>
示例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();
?>