本文整理汇总了PHP中ContentHelper::cutStringEx方法的典型用法代码示例。如果您正苦于以下问题:PHP ContentHelper::cutStringEx方法的具体用法?PHP ContentHelper::cutStringEx怎么用?PHP ContentHelper::cutStringEx使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContentHelper
的用法示例。
在下文中一共展示了ContentHelper::cutStringEx方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
<div class="rubric">
<?php
echo $data['content'];
?>
</div>
<?php
if ($data['is_active']) {
?>
<ul class="photo-list">
<?php
foreach ($photos as $photo) {
?>
<?php
$description = ContentHelper::cutStringEx($photo['description'], 100);
$imgThumbUrl = ImageHelper::imageUrl('portfolio_index_frontend', $photo['filename']);
$imgRawUrl = ImageHelper::imageUrl('raw', $photo['filename']);
?>
<li>
<a class="fancybox-button" rel="fancybox-button" href="<?php
echo $imgRawUrl;
?>
" title="<?php
echo $description;
?>
">
<img src="<?php
echo $imgThumbUrl;
?>
" alt="<?php
示例2: foreach
<ul class="album-list article-album">
<?php
foreach ($data as $blogs) {
?>
<?php
$arr = explode(' ', $blogs['publication_date']);
$timestamp = CDateTimeParser::parse($blogs['publication_date'], 'yyyy-MM-dd hh:mm:ss');
$date = Yii::app()->dateFormatter->format('d MMMM y', $timestamp);
$title = ContentHelper::cutStringEx($blogs['p_title'], 100);
$imgUrl = ImageHelper::imageUrl('blogs_slider', $blogs['filename']);
?>
<li title="<?php
echo $title;
?>
">
<a href="<?php
echo Yii::app()->createAbsoluteUrl('blogs/default/view', array('id' => $blogs['id']));
?>
">
<img style="width: 335px; height: 228px;" src="<?php
echo $imgUrl;
?>
" alt="<?php
echo $title;
?>
" title="<?php
echo $title;
?>
">
<span>
<span class="album-title"><?php
示例3:
<?php
$url = yii::app()->createAbsoluteUrl('portfolio/default/view/id/' . $data['post_id']);
$anounce = $data['anounce'];
$imgUrl = ImageHelper::imageUrl('portfolio_index_frontend', $data['filename']);
$title = ContentHelper::cutStringEx($data['p_title'], 100);
$timestamp = CDateTimeParser::parse($data['publication_date'], 'yyyy-MM-dd hh:mm:ss');
$date = Yii::app()->dateFormatter->format('d MMMM y', $timestamp);
$author = $data['firstname'] . ' ' . $data['lastname'];
?>
<li>
<a href="<?php
echo $url;
?>
">
<img src="<?php
echo $imgUrl;
?>
" alt="">
<span>
<span class="album-title"><?php
echo $title;
?>
</span>
<p><?php
echo $data['anounce'];
?>
</p>
<span class="album-date"><?php
echo $author;