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


PHP Common::makeFriendlyUrl方法代码示例

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


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

示例1: actionView

 public function actionView()
 {
     $radioId = Yii::app()->request->getParam("id", 0);
     $radioName = WapRadioModel::model()->findByPk($radioId)->name;
     $albumId = WapRadioModel::model()->getAlbumByRadio($radioId, "c2.id");
     $radioAvatar = RadioModel::model()->getAvatarUrl($radioId, 's1');
     $album = WapAlbumModel::model()->published()->findByPk($albumId);
     if (!$album) {
         $this->forward("/site/error", true);
     }
     $songsOfAlbum = WapSongModel::model()->getSongsOfAlbum($albumId);
     $artists = AlbumArtistModel::model()->getArtistsByAlbum($albumId);
     $phone = yii::app()->user->getState('msisdn');
     $errorCode = 'success';
     $errorDescription = '';
     $registerText = WapAlbumModel::model()->getCustomMetaData('REG_TEXT');
     ///meta tag
     $AlbumDetail = AlbumModel::model()->findByPk($albumId);
     $artistId = !empty($artists) ? $artists[0]->artist_id : $AlbumDetail->artist_id;
     $ArtistInfo = ArtistModel::model()->findByPk($artistId);
     $this->itemName = $AlbumDetail->name;
     $this->artist = $ArtistInfo->name;
     $this->thumb = AlbumModel::model()->getAvatarUrl($albumId, 's1');
     $this->url = URLHelper::buildFriendlyURL("album", $albumId, Common::makeFriendlyUrl($ArtistInfo->name));
     $this->description = strip_tags($AlbumDetail->description);
     //get other radio
     $parent_id = Yii::app()->params['horoscope']['parent_id'];
     $radioListOther = WapRadioModel::model()->getHoroscopes($parent_id);
     $this->render('detail', array('album' => $album, 'songsOfAlbum' => $songsOfAlbum, 'errorCode' => $errorCode, 'errorDescription' => $errorDescription, 'registerText' => $registerText, 'radioListOther' => $radioListOther, 'radioAvatar' => $radioAvatar));
 }
开发者ID:giangnh264,项目名称:mobileplus,代码行数:30,代码来源:HoroscopesController.php

示例2: __get

 public function __get($name)
 {
     if ($name == 'url_key') {
         $str = trim(parent::__get($name), "-");
         $str = str_replace("--", "-", $str);
         if (strrpos($str, "-") === false) {
             $str = Common::makeFriendlyUrl(trim($str));
         }
         return str_replace("'", "", $str);
     }
     return parent::__get($name);
 }
开发者ID:giangnh264,项目名称:mobileplus,代码行数:12,代码来源:MainContentModel.php

示例3: ArtistsByAlbumForWapDetail

 public static function ArtistsByAlbumForWapDetail($id)
 {
     $artists = AlbumArtistModel::model()->getArtistsByAlbum($id);
     $i = 0;
     $html = "";
     foreach ($artists as $artist) {
         $html .= $i > 0 ? " -&nbsp" : "";
         $html .= '<a href="' . URLHelper::buildFriendlyURL("artist", $artist->artist_id, Common::makeFriendlyUrl($artist->artist_name)) . '">' . $artist->artist_name . '</a>';
         $i++;
     }
     return $html;
 }
开发者ID:giangnh264,项目名称:mobileplus,代码行数:12,代码来源:ArtistHelper.php

示例4: actionDetail

 public function actionDetail()
 {
     $this->forward("/site/error", true);
     $new_id = (int) Yii::app()->request->getParam('id');
     $from = Yii::app()->request->getParam('from', '');
     $news = $detailnew = NewsModel::model()->findByPk($new_id);
     if (empty($news)) {
         $this->forward("/site/error", true);
     }
     $this->itemName = htmlspecialchars($detailnew->title);
     $this->keyword = $detailnew->title;
     $this->thumb = NewsModel::model()->getAvatarUrl($new_id, 's1');
     $this->url = URLHelper::buildFriendlyURL("news", $detailnew ? $new_id : 0, Common::makeFriendlyUrl($detailnew->title ? $detailnew->title : " "));
     $this->description = "";
     if ($from == 'api') {
         $this->layout = false;
     }
     $this->render('detail', compact('news', 'from'));
 }
开发者ID:giangnh264,项目名称:mobileplus,代码行数:19,代码来源:NewsController.php

示例5: actionView

 public function actionView()
 {
     $playlistId = Yii::app()->request->getParam('id');
     $playlist = WapPlaylistModel::model()->published()->findByPk($playlistId);
     $user_msisdn = $playlist->msisdn;
     if (!$playlist) {
         $this->forward("/site/error", true);
     }
     $songsOfPlaylist = WapPlaylistModel::model()->getSongs($playlistId);
     //samge user
     $countPlSameUser = WapPlaylistModel::model()->countPlaylistByPhone($this->userPhone);
     $playlistPages = new CPagination($countPlSameUser);
     $pageSize = Yii::app()->params['pageSize'];
     $playlistPages->setPageSize($pageSize);
     $currentPage = $playlistPages->getCurrentPage();
     $playlistsSameUser = WapPlaylistModel::model()->getSamePlaylistByPhone($playlist->id, $this->userPhone, $currentPage * $pageSize, $pageSize);
     $errorCode = 'success';
     $errorDescription = '';
     //for show price
     $checkPlay = WapUserTransactionModel::model()->checkCharging24h($this->userPhone, $this->userPhone, $playlistId, 'play_album');
     $userSub = $this->userSub;
     //WapUserSubscribeModel::model()->getUserSubscribe($phone);
     if ($checkPlay) {
         $playPrice = 0;
     } else {
         if ($userSub) {
             $playPrice = 0;
         }
     }
     if ($checkPlay) {
         $playPrice = 0;
     }
     // 		$registerText = WapAlbumModel::model()->getCustomMetaData('REG_TEXT');
     $this->itemName = $playlist->name;
     $this->artist = "Chacha";
     //$playlist->username;
     $this->thumb = UserModel::model()->getThumbnailUrl('s1', $playlist->user_id);
     $this->url = URLHelper::buildFriendlyURL("playlist", $playlist->id, Common::makeFriendlyUrl($playlist->name));
     $this->description = $playlist->name;
     $this->render('view', array('playlist' => $playlist, 'songsOfPlaylist' => $songsOfPlaylist, 'playlistsSameUser' => $playlistsSameUser, 'playlistPages' => $playlistPages, 'errorCode' => $errorCode, 'errorDescription' => $errorDescription, 'userSub' => $userSub, 'user_msisdn' => $user_msisdn));
 }
开发者ID:giangnh264,项目名称:mobileplus,代码行数:41,代码来源:PlaylistController.php

示例6: actionDownload

 public function actionDownload()
 {
     $this->layout = false;
     $contentId = (int) Yii::app()->request->getParam('id');
     $type = Yii::app()->request->getParam('type', 'downloadSong');
     $deviceId = yii::app()->session['deviceId'];
     $downloadUrl = '';
     if ($type == 'downloadVideo') {
         $video = WapVideoModel::model()->findByPk($contentId);
         $downloadUrl = VideoModel::model()->getDownloadUrl($contentId, $deviceId, 'http', true);
         $contentType = 'video/mp4';
         $fileName = $video->name;
         $fileName = Common::makeFriendlyUrl($fileName) . ".mp4";
     } elseif ($type == 'downloadSong') {
         $song = WapSongModel::model()->findByPk($contentId);
         //$downloadUrl = WapSongModel::model()->getNiceDownloadUrl($song->id, $deviceId, 'http', $song->profile_ids, $song->url_key, $song->artist_name);
         //$downloadUrl = WapSongModel::model()->getAudioFileUrl($song->id, $deviceId, 'http', $song->profile_ids);
         $downloadUrl = WapSongModel::model()->getNiceDownloadUrl($song->id, $deviceId, 'http', $song->profile_ids, $song->url_key, $song->artist_name);
         echo '<meta http-equiv="refresh" content="0;url=' . $downloadUrl . '" />';
         exit;
         $contentType = 'audio/mpeg';
         $fileName = $song->name;
         $fileName = Common::makeFriendlyUrl($fileName) . ".mp3";
     }
     echo '<meta http-equiv="refresh" content="0;url=' . $downloadUrl . '" />';
     exit;
     //$this->redirect($downloadUrl);
     //Yii::app()->end();
     //echo '<meta http-equiv="refresh" content="0;url='.$downloadUrl.'" />';
     header("Cache-Control: public");
     header("Content-Description: File Transfer");
     header("Content-Disposition: attachment; filename=" . $fileName);
     header("Content-Type: {$contentType}");
     header("Content-Transfer-Encoding: binary");
     readfile($downloadUrl);
     //Yii::app()->end();
     //Common::DownloadWithName($this->userPhone, $contentId, $type);
     exit;
 }
开发者ID:giangnh264,项目名称:mobileplus,代码行数:39,代码来源:DefaultController.php

示例7: foreach

<div class="page-404">
	<?php 
$albums = MainContentModel::getListByCollection('ALBUM_HOT', 0, 4);
?>
	<p class="img-404">
		<img src="/touch/images/404.png"/>
	</p>
	<ul class="album_list items-list pt30">
		<?php 
$i = 0;
foreach ($albums as $key => $album) {
    $artist_name = ArtistHelper::ArtistNamesByAlbum($album['id']);
    $i++;
    $albumLink = yii::app()->createUrl('album/view', array('id' => $album['id'], 'url_key' => Common::makeFriendlyUrl($album['name']), "artist" => Common::makeFriendlyUrl(trim($album['artist_name']))));
    if ($album['id']) {
        $avatarImage = CHtml::image(WapAlbumModel::model()->getThumbnailUrl(100, $album['id']), 'avatar', array('class' => 'avatar'));
    } else {
        $avatarImage = CHtml::image('/images/icon/clip-50.png', '', array('class' => 'avatar'));
    }
    ?>
			<li class="item <?php 
    if ($i == count($albums)) {
        echo 'last_item';
    }
    ?>
">
				<a href="<?php 
    echo $albumLink;
    ?>
">
					<?php 
开发者ID:giangnh264,项目名称:mobileplus,代码行数:31,代码来源:error.php

示例8: foreach

        foreach ($list_video as $item) {
            ?>
                        <li class="item-video-playlist <?php 
            echo $video->id == $item->id ? 'selected' : '';
            ?>
"
                            id="video-item-<?php 
            echo $i;
            ?>
" rel="<?php 
            echo $item->id;
            ?>
">
                            <?php 
            $playUrl = VideoModel::model()->getVideoFileUrl($item->id, $deviceId, 'rtsp', true);
            $videoPlaylistLink = Yii::app()->createUrl('videoPlaylist/view', array('id' => $content->id, 'url_key' => Common::makeFriendlyUrl($item['name']), 'video_id' => $item->id));
            ?>
                            <a data-toggle="modal" data-freeview="1" data-allowview="3" data-pricev="0" data-priced="0"
                               data-id="39618" data-3g="0" data-hp="0" href="javascript:void(0)"
                               class="thumb-link popup-modal">
                                <?php 
            $avatarImage = CHtml::image(WapVideoModel::model()->getThumbnailUrl(100, $item['id']), 'avatar', array('class' => 'video-avatar', 'align' => 'left'));
            ?>
                                <div class="thumb">
                                    <?php 
            echo $avatarImage;
            ?>
                                </div>
                                <h2><?php 
            echo Formatter::smartCut(CHtml::encode($item['name']), Yii::app()->params['limit_substring_title'], 0);
            ?>
开发者ID:giangnh264,项目名称:mobileplus,代码行数:31,代码来源:_videoplaylistView.php

示例9: foreach

        <p class="singer over-text"><a title="<?php 
echo CHtml::encode($album->artist_name);
?>
" ><?php 
echo CHtml::encode($album->artist_name);
?>
</a></p>
    </div>
</div>


<ul class="bxh_album_list song_detail_list mart20">
    <?php 
foreach ($songs as $song) {
    $urlKey = Common::makeFriendlyUrl(trim($song->song->name));
    $artist_name = Common::makeFriendlyUrl($song->artist_name);
    $link = Yii::app()->createUrl("song/view", array("id" => $song->song_id, "title" => $urlKey, 'artist' => $artist_name));
    $artistLink = Yii::app()->createUrl("/search") . "?" . http_build_query(array("q" => CHtml::encode($song->song->artist_name)));
    $artistId = SongArtistModel::model()->findByAttributes(array('song_id' => $song->song->id))->artist_id;
    $image = AvatarHelper::getAvatar("artist", $artistId, 640);
    ?>
        <li>
            <a href="<?php 
    echo $link;
    ?>
">
                <img src="<?php 
    echo $image;
    ?>
" alt="<?php 
    echo CHtml::encode($song->song->artist_name);
开发者ID:giangnh264,项目名称:mobileplus,代码行数:31,代码来源:_songInAlbum.php

示例10: makeUrlGenre

 public static function makeUrlGenre($object)
 {
     Yii::import("application.vendors.Hashids.*");
     $hashids = new Hashids(Yii::app()->params["hash_url"]);
     $type = $object['type'];
     $name = $object['name'];
     $id = $object['id'];
     $gt = isset($object['gt']) ? $object['gt'] : '';
     $suffix = 'gr';
     $code = $hashids->encode($id);
     $code = $suffix . $code;
     $prefix = 'nhac-';
     $urlKey = $prefix . Common::makeFriendlyUrl($name);
     if ($type == 'song') {
         $type = 'bai-hat';
     }
     $params = array("action" => $type, "url_key" => $urlKey, "code" => $code);
     if (!empty($gt)) {
         if ($gt == 'new') {
             $gt = 'moi';
         }
         $params['gt'] = $gt;
     }
     if (isset($object['other'])) {
         foreach ($object['other'] as $key => $ac) {
             $params[$key] = $ac;
         }
     }
     $link = Yii::app()->createAbsoluteUrl("site/url2", $params);
     return $link;
 }
开发者ID:giangnh264,项目名称:mobileplus,代码行数:31,代码来源:URLHelper.php

示例11: array

<ul class="list_bxh ovh" style="border-bottom: none;">
<?php 
if ($data) {
    ?>
<li>
	<div style="overflow: hidden;margin-bottom: 5px;">
	<a href="<?php 
    echo Yii::app()->createUrl("collection/view", array("id" => $collection->id, "title" => Common::makeFriendlyUrl(CHtml::encode($collection->name))));
    ?>
" class="play_all"><span>playall</span></a>
	</div>
</li>
<?php 
    $i = 1;
    foreach ($data as $song) {
        $urlKey = $song->url_key ? $song->url_key : Common::makeFriendlyUrl($song->name);
        $link = Yii::app()->createUrl("song/view", array("id" => $song->id, 'title' => trim($urlKey, "-")));
        ?>
	<?php 
        if ($i == 1) {
            ?>
		<li>
			<div class="chart-index chart-1st"><b>1</b></div>
			<div class="chart-content-1st">
				<a href="<?php 
            echo $link;
            ?>
" title="<?php 
            echo CHtml::encode($song->name) . ' - ' . CHtml::encode($song->artist_name);
            ?>
">
开发者ID:giangnh264,项目名称:mobileplus,代码行数:31,代码来源:_songChartForSongPage.php

示例12: foreach

    if ($numFound > 0 && $objType == 'search') {
        ?>
    <div class="bl_title padL10 padT5 padB5 fontB"><?php 
        echo yii::t('chachawap', 'Tìm thấy ') . $numFound . yii::t('chachawap', ' nhạc chuông');
        ?>
</div>
<?php 
    }
    ?>
<table class="tablelist">
    <?php 
    foreach ($ringtones as $ringtone) {
        if (!empty($ringtone->ringtone)) {
            $ringtone = $ringtone->ringtone;
        }
        $ringtoneLink = yii::app()->createUrl('ringtone/view', array('id' => $ringtone->id, 'url_key' => Common::makeFriendlyUrl($ringtone->name)));
        $avatarImage = CHtml::image(WapArtistModel::model()->getThumbnailUrl(50, $ringtone->artist_id), 'avatar', array('class' => 'avatar'));
        ?>
	<tr><td width="65px">
            <?php 
        if ($type != "noavatar") {
            echo $avatarImage;
        }
        ?>
		</td>
        <td class="itemwrap" onclick="document.location = '<?php 
        echo $ringtoneLink;
        ?>
'">
            <p class="m0 fontB">
                <a href="<?php 
开发者ID:giangnh264,项目名称:mobileplus,代码行数:31,代码来源:RingtoneListWidget.php

示例13: foreach

if ($data) {
    ?>
    <div class="listview <?php 
    echo $this->layout;
    ?>
">
        <h3 class="title"><?php 
    echo $title;
    ?>
</h3>
        <ul class="items-listview">
            <?php 
    foreach ($data as $item) {
        ?>
                <?php 
        $link = Yii::app()->createUrl('/post/view', array('id' => $item->_id, 'url_key' => Common::makeFriendlyUrl($item->title)));
        //$image = FeedModel::model()->getAvatarUrl($item->second_thumb);
        $image = $item->second_thumb;
        ?>
                <li class="item">
                    <div>
                        <div class="vil-thumb">
                            <div class="wrr-thumb">
                                <a href="<?php 
        echo $link;
        ?>
"><img width="100%" alt="<?php 
        echo $item->title;
        ?>
" width="100%" src="<?php 
        echo $image;
开发者ID:phuongitvn,项目名称:vdh,代码行数:31,代码来源:listview_vertical.php

示例14: array

<?php

$this->pageTitle = $article->title;
$this->breadcrumbs = array($article->genre => Yii::app()->createUrl('/category/index', array('url_key' => Common::makeFriendlyUrl($article->genre))), $article->title);
?>

<?php 
$this->renderPartial('_view', array('article' => $article));
?>

<div id="comments">
	<?php 
if ($article->comments >= 1) {
    ?>
		<h3>
			<?php 
    echo $article->comments > 1 ? $article->comments . ' comments' : 'One comment';
    ?>
		</h3>

		<?php 
    $this->renderPartial('_comments', array('post' => $article, 'comments' => $article->comments));
    ?>
	<?php 
}
?>

	<h3>Leave a Comment</h3>

	<?php 
if (Yii::app()->user->hasFlash('commentSubmitted')) {
开发者ID:phuongitvn,项目名称:vdh,代码行数:31,代码来源:view.php

示例15: explode

    ?>
" href="<?php 
    echo $link;
    ?>
"><?php 
    echo Formatter::smartCut(CHtml::encode($song->name), 30);
    ?>
</a></h3>
            <p>
        <?php 
    //artist link new
    $j = 0;
    $artistList = explode(",", $song->artist_object);
    foreach ($artistList as $item) {
        $artists = explode("|", $item);
        $urlKey = Common::makeFriendlyUrl(trim($artists[1]));
        $artistLink = Yii::app()->createUrl("artist/view", array("id" => $artists[0], "title" => $urlKey));
        //end artist link new
        ?>
                <a title="<?php 
        echo CHtml::encode($artists[1]);
        ?>
" href="<?php 
        echo $artistLink;
        ?>
"><?php 
        echo Formatter::smartCut($artists[1], 20);
        ?>
                </a>
            <?php 
        if (count($artistList) > 1 && $j < count($artistList) - 1) {
开发者ID:giangnh264,项目名称:mobileplus,代码行数:31,代码来源:_songByGenre.php


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