当前位置: 首页>>代码示例>>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;未经允许,请勿转载。