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


PHP Formatter::smartCut方法代码示例

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


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

示例1: Array

            name:"<?php 
echo CHtml::encode($videoPlaylist->name);
?>
",
            listSong:{}
        };
        listSong = Array();
        <?php 
foreach ($list_video as $key => $song) {
    $playUrl = WapVideoModel::model()->getVideoFileUrl($song->id, $deviceId, 'rtsp', true);
    $playHD = 'http://video.chacha.vn:8282/videos/output/11/95154/9.mp4';
    $img = WapVideoModel::model()->getThumbnailUrl(320, $song->id);
    ?>
        var item = {
            title: "<?php 
    echo Formatter::smartCut($song->name, 20);
    ?>
",
            url_normal: "<?php 
    echo $playUrl;
    ?>
",
            url_hd: "<?php 
    echo $playHD;
    ?>
",
            img: "<?php 
    echo $img;
    ?>
"
        };
开发者ID:giangnh264,项目名称:mobileplus,代码行数:31,代码来源:_videoplaylistView.php

示例2: str_pad

        ?>
">
                        <span class="album_order"><?php 
        echo str_pad($i + 1, 2, "0", STR_PAD_LEFT);
        ?>
</span>

                        <h3><?php 
        echo $songName;
        ?>
</h3>
                        <div class="artist"><a href="<?php 
        echo $artistLink;
        ?>
" class="singer"><?php 
        echo Formatter::smartCut(CHtml::encode($song->artist_name), 23);
        ?>
</a></div>

                        <div class="meta-content hide" style="display: none;">
                            <span class="content_song_id"><?php 
        echo $song->id;
        ?>
</span>
                        </div>
                        <div style="display: none" id="lyrics-<?php 
        echo $song->id;
        ?>
"><?php 
        echo $song->lyrics;
        ?>
开发者ID:giangnh264,项目名称:mobileplus,代码行数:31,代码来源:play_song_list.php

示例3: array

	<li class="item <?php 
    if ($i == count($news)) {
        echo 'last_item';
    }
    ?>
">
		<a href="<?php 
    echo $link;
    ?>
" title=" <?php 
    echo CHtml::encode($new->title);
    ?>
">
			<?php 
    $avatarImage = CHtml::image(WapNewsModel::model()->getThumbnailUrl('s3', $new->id), 'avatar', array('class' => 'news-avatar', 'align' => 'left', 'title' => CHtml::encode($new->title), 'width' => '120', 'height' => '80'));
    echo $avatarImage;
    ?>
                    <h3 class="subtext"><?php 
    echo $new->title, 25;
    ?>
</h3>
			<p><?php 
    echo CHtml::encode(Formatter::smartCut($new->intro, 30));
    ?>
</p>
		</a>
	</li>
	<?php 
}
?>
</ul>
开发者ID:giangnh264,项目名称:mobileplus,代码行数:31,代码来源:list.php

示例4:

    ?>
" alt="<?php 
    echo CHtml::encode($song->song->artist_name);
    ?>
">
            </a>
            <h3><a title="<?php 
    echo CHtml::encode($song->song->name);
    ?>
" href="<?php 
    echo $link;
    ?>
"><?php 
    echo Formatter::smartCut(CHtml::encode($song->song->name), 30);
    ?>
</a></h3>
            <p><a title="<?php 
    echo CHtml::encode($song->song->artist_name);
    ?>
" href="<?php 
    echo $artistLink;
    ?>
"><?php 
    echo Formatter::smartCut($song->song->artist_name, 20);
    ?>
</a></p>
        </li>
    <?php 
}
?>
</ul>
开发者ID:giangnh264,项目名称:mobileplus,代码行数:31,代码来源:_songInAlbum.php

示例5: foreach

" class="fs11">Xem thêm <i class="icon icon_mt"></i></a>
</div>
<div class="content_box">
	<ul class="list_bxh ovh">
	<?php 
    foreach ($videos as $video) {
        $link = Yii::app()->createUrl("video/detail", array("id" => $video->id, "title" => trim($video->url_key, "-")));
        ?>
		<li><span class="fll"><h3>
					<a href="<?php 
        echo $link;
        ?>
" title="<?php 
        echo CHtml::encode($video->name);
        ?>
">
					<?php 
        echo Formatter::smartCut(CHtml::encode($video->name), 22);
        ?>
</a>
				</h3></span> <h4 class="flr gray_color"><?php 
        echo Formatter::smartCut($video->video_artist[0]->artist_name, 12);
        ?>
</h4></li>
	<?php 
    }
    ?>
	</ul>
</div>
<?php 
}
开发者ID:giangnh264,项目名称:mobileplus,代码行数:31,代码来源:_videoByArtists.php

示例6: foreach

		<?php 
    $i = 0;
    foreach ($rbts as $rbt) {
        ?>
			<li>
				<div class="zone-1">
					<div class="rbt-name width40"><?php 
        echo Formatter::smartCut(CHtml::encode($rbt['name_song']), 40);
        ?>
 <span class="rbt-price">(<?php 
        echo $rbt['price'];
        ?>
Đ)</span></div>
					<div class="rbt-price width15">
						<span class="rbt-artist"><?php 
        echo Formatter::smartCut(CHtml::encode($rbt['name_singer']), 14);
        ?>
</span>
					</div>
				</div>
				<div class="zone-2">
					<div class="rbt-download width15"><a href="javascript:;" title="<?php 
        echo Yii::t('web', 'Download');
        ?>
" class="icon_down_rbt"  onclick="downloadrbt('<?php 
        echo $rbt['name_song'];
        ?>
','<?php 
        echo $rbt['name_singer'];
        ?>
','<?php 
开发者ID:giangnh264,项目名称:mobileplus,代码行数:31,代码来源:_popupRbt.php

示例7: foreach

    foreach ($songs as $song) {
        $artist_name = Common::makeFriendlyUrl($song->artist_name);
        $link = Yii::app()->createUrl('song/view', array('id' => $song->id, 'url_key' => Common::makeFriendlyUrl($song->name), 'artist' => $artist_name));
        ?>
<li class="item">
    <a href="<?php 
        echo $link;
        ?>
">
 		<i class="vg_icon icon_song"></i>
 		<h3><?php 
        echo CHtml::encode($song->name);
        ?>
</h3>
	 		<ul class="info">
            	<li><i class="vg_icon icon_artist"></i>
            	<?php 
        echo Formatter::smartCut($song->artist_name, Yii::app()->params['limit_substring'], 0);
        ?>
            	</li>
            </ul>
	</a>
</li>
		
<?php 
    }
} else {
    ?>
<li>Không có bài hát nào</li>
<?php 
}
开发者ID:giangnh264,项目名称:mobileplus,代码行数:31,代码来源:_ajax_song_list.php

示例8:

" src="<?php 
    echo $product_img[0]['img_url'];
    ?>
">
                                    </a>
                                </div>

                                <div class="wrr-item-content">
                                    <p class="item_main">
                                        <?php 
    echo Formatter::smartCut($product->name, 20);
    ?>
                                    </p>
                                    <p class="item_sub">
                                        <?php 
    echo Formatter::smartCut($product->description, 60);
    ?>
                                    </p>
                                </div>
                            </div>
                        </div>
                    </div>
                    <?php 
    if (fmod($i, 4) == 3 || $i == count($product_relate) - 1) {
        echo '</ul>';
    }
    $i++;
}
?>
            </div>
            </div>
开发者ID:giangnh264,项目名称:mobileplus,代码行数:31,代码来源:view.php

示例9: http_build_query

    ?>
"><img src="<?php 
    echo AvatarHelper::getAvatar("artist", $song['artist_id'], 50);
    ?>
" alt="<?php 
    echo $song['name'];
    ?>
" width="50" height="50" /></a>
	<h3><a href="<?php 
    echo $link;
    ?>
" class="song_name"><?php 
    echo Formatter::smartCut(CHtml::encode($song['name']), 24);
    ?>
</a></h3>
	<?php 
    $linkArtist = Yii::app()->createUrl("/search") . "?" . http_build_query(array("q" => CHtml::encode(CHtml::encode($song['artist_name']))));
    ?>
	<h4 class="song_aritis"><a href="<?php 
    echo $linkArtist;
    ?>
" title="<?php 
    echo CHtml::encode($song['artist_name']);
    ?>
"><?php 
    echo Formatter::smartCut(CHtml::encode($song['artist_name']), 25);
    ?>
</a></h4>
</li>
<?php 
}
开发者ID:giangnh264,项目名称:mobileplus,代码行数:31,代码来源:_topListen.php

示例10: foreach

    echo $item->name;
    ?>
</a></p>
			<ul class="sub_list_genre">
			<?php 
    foreach ($genresAll as $key1 => $genre) {
        ?>
				<?php 
        if ($genre->parent_id == $item->id) {
            $genreLink = URLHelper::makeUrlGenre(array("type" => $type, 'name' => $genre->name, 'id' => $genre->id, 'gt' => $s));
            ?>
            		<li><a href="<?php 
            echo CHtml::encode($genreLink);
            ?>
"><i class="vg_icon icon_liii"></i><?php 
            echo Formatter::smartCut(CHtml::encode($genre->name), 20, 0);
            ?>
</a></li>
            	<?php 
        }
        ?>
			<?php 
    }
    ?>
			</ul>
			</li>
		<?php 
}
?>
		</ul>
	</div>
开发者ID:giangnh264,项目名称:mobileplus,代码行数:31,代码来源:genre.php

示例11: array

    ?>
">Đăng ký</a></li>
            <?php 
} else {
    ?>
            	<li class="sub_hover user-menu">
            	<img class="user-avatar" src="<?php 
    echo AvatarHelper::getAvatar("user", Yii::app()->user->id, 50);
    ?>
" width="25" height="25" />
            		<a href="<?php 
    echo Yii::app()->createUrl("/user/detail");
    ?>
">
            			<span><?php 
    echo Formatter::smartCut(Yii::app()->user->username, 12);
    ?>
</span>
            		</a>
            		<ul class="sub_nav">
	            		<li><a href="<?php 
    echo Yii::app()->createUrl("/user/detail", array('id' => $userId, 'tab' => 'playlist'));
    ?>
">Playlist của tôi</a></li>
		                <li><a href="<?php 
    echo Yii::app()->createUrl("/user/detail", array('id' => $userId, 'tab' => 'song'));
    ?>
">Bài hát của tôi</a></li>
		                <li><a href="<?php 
    echo Yii::app()->createUrl("/user/detail", array('id' => $userId, 'tab' => 'mv'));
    ?>
开发者ID:giangnh264,项目名称:mobileplus,代码行数:31,代码来源:main_tet.php

示例12: count

		<h3><?php 
        echo Formatter::smartCut(CHtml::encode($video['name']), Yii::app()->params['limit_substring_title'], 0);
        ?>
</h3>
		<ul class="info"><li>
		        	<?php 
        /* $artists = explode(',', $video->artist_name);
           $count = count($artists);
           $i = 1;
           $artist_name="";
           foreach ($artists as $artist) {
           	$artist = trim($artist);
               $artist_name .= $artist;
               if ($i < $count)
               	$artist_name .= "&nbsp;-&nbsp;";
               $i++;
           } */
        echo Formatter::smartCut($video['artist_name'], Yii::app()->params['limit_substring'], 0);
        ?>
		        </li>
		</ul>
	</a>
</li>

<?php 
    }
} else {
    ?>
<div>Không tìm thấy video nào!</div>
<?php 
}
开发者ID:giangnh264,项目名称:mobileplus,代码行数:31,代码来源:_ajax_video_list.php

示例13: http_build_query

if ($type == 'bxh') {
    if (isset($type)) {
        $params['type'] = $type;
    }
    if (isset($s)) {
        $params['s'] = $s;
    }
    $link1 = Yii::app()->createUrl('/ajax/getPopup') . '?' . http_build_query($params);
} else {
    $link1 = Yii::app()->createUrl('/ajax/getPopup') . '?' . http_build_query($params);
}
?>
<div class="pad10">
<div class="vg_option list-label mr-t-15 clearfix">
	<a href="<?php 
echo $link1;
?>
" class="opt_genre ajax_popup"><span class="fll"><?php 
echo Formatter::smartCut($cTitle, 15, 0);
?>
</span> <i class="vg_icon icon_11"></i></a>
	<a href="<?php 
echo Yii::app()->createUrl('/ajax/getPopup') . '?' . http_build_query(array('route' => $route, 'type' => $type2, 'c' => $c, 'name' => CHtml::encode($cTitle)));
?>
" class="opt_type ajax_popup"><span class="fll"><?php 
echo $sTitle;
?>
</span> <i class="vg_icon icon_11"></i></a>
</div>
</div>
开发者ID:giangnh264,项目名称:mobileplus,代码行数:30,代码来源:_filter_nav.php

示例14: date

                            <a href="<?php 
    echo $link;
    ?>
">
                                <h4 class="title" style="font-weight: bold"><?php 
    echo CHtml::encode(Formatter::smartCut($news[0]->title, 50));
    ?>
</h4>
                                <p class="time-news">(<?php 
    echo date('d/m H:i', strtotime($news[0]->created_time));
    ?>
)</p>
                            </a>
                    </div>
                    <div class="intro"><?php 
    echo CHtml::encode(Formatter::smartCut($news[0]->intro, 110));
    ?>
</div>
                </div>
                <?php 
    for ($i = 1; $i < count($news); $i++) {
        $item = $news[$i];
        $link = Yii::app()->createUrl('news/detail', array('id' => $item->id, 'url_key' => Common::makeFriendlyUrl($item->title)));
        ?>
                    <div class="item_row news_row <?php 
        if ($i == count($news) - 1) {
            echo 'last_item';
        }
        ?>
">
                        <a href="<?php 
开发者ID:giangnh264,项目名称:mobileplus,代码行数:31,代码来源:index.php

示例15:

				<a href="<?php 
        echo $albumLink;
        ?>
">
				<div class="wrr-item-detail">
				<img src="<?php 
        echo $avatarImage;
        ?>
" />
					<div class="info-nav">
						<p class="title"><?php 
        echo Formatter::smartCut(CHtml::encode($value['name']), 15, 0);
        ?>
</p>
						<p class="artist"><?php 
        echo Formatter::smartCut(CHtml::encode($value['artist_name']), 15, 0);
        ?>
</p>
					</div>
				</div>
				</a>
			</div>
		<?php 
        $i++;
        ?>
		<?php 
        if ($i % 2 == 0 && $i != 0) {
            echo "</div>";
        } else {
            echo '<div class="space"></div>';
        }
开发者ID:giangnh264,项目名称:mobileplus,代码行数:31,代码来源:index.php


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