當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Settings::toLatin方法代碼示例

本文整理匯總了PHP中Settings::toLatin方法的典型用法代碼示例。如果您正苦於以下問題:PHP Settings::toLatin方法的具體用法?PHP Settings::toLatin怎麽用?PHP Settings::toLatin使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Settings的用法示例。


在下文中一共展示了Settings::toLatin方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: createUrl

 public function createUrl($route, $params = array(), $ampersand = '&')
 {
     if (empty($params['language']) && Yii::app()->language !== 'ru') {
         $params['language'] = Yii::app()->language;
     }
     if (!isset(Yii::app()->controller->module->id)) {
         if (!strstr($route, 'register')) {
             if (isset($_POST['city'])) {
                 $cookie = new CHttpCookie('city', $_POST['city']);
                 Yii::app()->request->cookies['city'] = $cookie;
                 $cookie->expire = time() + 3600;
                 $c = City::model()->localized('ru')->findByPk($_POST['city'])->name;
                 $params['city'] = Settings::toLatin($c);
             } elseif (isset(Yii::app()->request->cookies['city'])) {
                 $c = City::model()->localized('ru')->findByPk(Yii::app()->request->cookies['city']->value)->name;
                 $params['city'] = Settings::toLatin($c);
             } else {
                 unset($params['city']);
             }
         } else {
             unset($params['city']);
         }
     }
     /*if (!strstr($route,'/')) {
           $route = '/cat/'.$route;
       }*/
     return Yii::app()->request->hostInfo . parent::createUrl($route, $params, $ampersand);
 }
開發者ID:schur-maksim,項目名稱:happymoments.ua,代碼行數:28,代碼來源:UrlManager.php

示例2: actionIndex

 public function actionIndex()
 {
     $urls = array();
     // Actions
     $urls[] = $this->createUrl('actions/index');
     $actions = Actions::model()->findAll('t.picture != "" AND t.date_end <= ' . date('Y-m-d'));
     if (count($actions) > 0) {
         foreach ($actions as $action) {
             $urls[] = $this->createUrl('actions/view', array('id' => $action->id));
         }
     }
     // Tenders
     $urls[] = $this->createUrl('tenders/index');
     $tenders = Tenders::model()->findAll('t.date_end <= ' . date('Y-m-d'));
     if (count($tenders) > 0) {
         foreach ($tenders as $tender) {
             $urls[] = $this->createUrl('tenders/view', array('id' => $tender->id));
         }
     }
     // Freefoto
     $urls[] = $this->createUrl('freefoto/index');
     // Static Pages
     $urls[] = $this->createUrl('page/hmagent');
     $urls[] = $this->createUrl('page/advertisment');
     $urls[] = $this->createUrl('page/help_us');
     $urls[] = $this->createUrl('page/about');
     $urls[] = $this->createUrl('page/accounts');
     // News
     $urls[] = $this->createUrl('page/news');
     $news = News::model()->findAll('t.title != "" AND t.intro_text != ""');
     if (count($news) > 0) {
         foreach ($news as $item) {
             $urls[] = $this->createUrl('page/news', array('id' => $item->id));
         }
     }
     // Categories
     $cats = Occupation::model()->localized('ru')->findAll(array('condition' => 't.name!="" AND t.active=1', 'order' => 't.cat_id ASC'));
     if (count($cats) > 0) {
         foreach ($cats as $cat) {
             $urls[] = $this->createUrl('/cat/view', array('id' => 'c' . $cat->id . '_' . Settings::toLatin($cat->name)));
         }
     }
     // Users
     $users = Users::model()->findAll('t.name!="" AND t.activate=1');
     if (count($users) > 0) {
         foreach ($users as $user) {
             if ($user->filesCount >= 4 || $user->videosCount >= 4 || $user->floCount >= 4) {
                 $urls[] = '/id' . $user->id;
                 // Photo albums
                 if ($user->occupation_id == 1) {
                     $alb = Portfolio::model()->findAllByAttributes(array('uid' => $user->id, 'visible' => 1));
                     if (count($alb) > 0) {
                         foreach ($alb as $item) {
                             if ($item->filesCount > 0) {
                                 $urls[] = $this->createUrl('user/album', array('id' => $item->id));
                             }
                         }
                     }
                 }
                 // Video albums
                 if ($user->occupation_id == 2) {
                     $vid = Video::model()->findAllByAttributes(array('uid' => $user->id, 'visible' => 1));
                     if (count($vid) > 0) {
                         foreach ($vid as $item) {
                             if ($item->filesCount > 0) {
                                 $urls[] = $this->createUrl('user/videoalbum', array('id' => $item->id));
                             }
                         }
                     }
                 }
             }
         }
     }
     // Photo albums
     $users_alb = Users::model()->findAll('t.name!="" AND t.activate=1 AND t.occupation_id=1');
     if (count($users_alb) > 0) {
         foreach ($users_alb as $user_alb) {
             if ($user_alb->filesCount >= 4 || $user->videosCount >= 4 || $user->floCount >= 4) {
                 $urls[] = '/id' . $user->id;
             }
         }
     }
     /*// Страницы
             $pages = Page::model()->findAll(array(
                 'condition' => 't.public = 1';
             ));
             foreach ($posts as $page){
                 $urls[] = $this->createUrl('page/view', array('alias'=>$page->alias));
             }
      
             // Новости
             $news = News::model()->findAll(array(
                 'condition' => 't.public = 1';
             ));
             foreach ($news as $new){
                 $urls[] = $this->createUrl('news/view', array('id'=>$new->id));
             }
      
             // Работы портфолио
             $works = Work::model()->findAll(array(
//.........這裏部分代碼省略.........
開發者ID:schur-maksim,項目名稱:happymoments.ua,代碼行數:101,代碼來源:SitemapController.php

示例3: array

<?php

/* @var $this ProfileController */
$this->breadcrumbs = array(Occupation::getName($model->occupation_id) => $this->createUrl('cat/view', array('alias' => Settings::toLatin(Occupation::getName($model->occupation_id)))), $model->name);
if (!Yii::app()->user->isGuest) {
    if (Yii::app()->user->id != $model->id) {
        Users::addHit($model->id);
    }
} else {
    Users::addHit($model->id);
}
Yii::app()->clientScript->registerScriptFile(Yii::app()->theme->baseUrl . '/js/min/jquery.nanoscroller.min.js');
Yii::app()->clientScript->registerScriptFile(Yii::app()->theme->baseUrl . '/js/min/jquery.stellar.min.js');
Yii::app()->clientScript->registerScriptFile(Yii::app()->theme->baseUrl . '/js/min/jquery.fancybox.pack.js');
Yii::app()->clientScript->registerScriptFile(Yii::app()->theme->baseUrl . '/js/min/jquery.tooltipster.min.js');
Yii::app()->clientScript->registerScriptFile(Yii::app()->theme->baseUrl . '/js/masked.js');
?>

<script>
$(document).ready(function(){
   $("#phone").mask("+38(999) 999-99-99"); 
    
   $("#phone_user").click(function(){
      $.ajax({
          url: '<?php 
echo $this->createUrl('/user/getphone');
?>
',
          type: "POST",
          data: {'id':$('#phone_user').attr('data-phone')},
          success: function (data) {
開發者ID:schur-maksim,項目名稱:happymoments.ua,代碼行數:31,代碼來源:view_studio.php

示例4: foreach

foreach ($list as $k => $v) {
    //if($i%8==0) {
    //    echo '</ul></li>';
    //    echo '      <li class="dropdownmenu__item">
    //            <ul class="dropdownmenu__item__list">';
    //}
    echo '<li class="dropdownmenu__item__list__item"><h3 class="dropdownmenu__item__list__item__title">' . $v->name . '</h3></li>';
    $model = new Occupation();
    $list1 = $model->localized('ru')->findAll('cat_id=:cid', array(':cid' => $v->id));
    $i = 1;
    foreach ($list1 as $k1 => $v1) {
        //echo '<li class="dropdownmenu__item__list__item"><a href="" class="dropdownmenu__item__list__item__link">Воздушные акробаты<span class="dropdown__link__col">&nbsp;(25)</span></a></li>';
        if ($v1->alias != '') {
            $alias = $v1->alias;
        } else {
            $alias = Settings::toLatin($v1->name);
            Occupation::model()->updateByPk($v1->id, array('alias' => $alias));
        }
        if (Yii::app()->getRequest()->getParam('id') == $v1->id && Yii::app()->controller->id == 'cat') {
            echo '<li class="dropdownmenu__item__list__item"><a href="' . $this->createUrl('/cat/view', array('alias' => $alias)) . '" class="dropdownmenu__item__list__item__link dropdownmenu__item__list__item__link--current">' . $v1->name . '<span class="dropdown__link__col">&nbsp;(' . Occupation::CalcUsers($v1->id) . ')</span></a></li>';
        } else {
            echo '<li class="dropdownmenu__item__list__item"><a href="' . $this->createUrl('/cat/view', array('alias' => $alias)) . '" class="dropdownmenu__item__list__item__link">' . $v1->name . '<span class="dropdown__link__col">&nbsp;(' . Occupation::CalcUsers($v1->id) . ')</span></a></li>';
        }
        //$i++;
    }
}
?>
            </ul>
          </li>  
        </ul>
    </div>
開發者ID:schur-maksim,項目名稱:happymoments.ua,代碼行數:31,代碼來源:main.php


注:本文中的Settings::toLatin方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。