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


PHP yii::beginProfile方法代碼示例

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


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

示例1: renderContent

 protected function renderContent()
 {
     yii::beginProfile('loc');
     $session = new CHttpSession();
     $session->open();
     $newCountry = $this->newCountry ? $this->newCountry : ($session['top-country'] ? $session['top-country'] : $this->defaultCountry);
     $session['top-country'] = $newCountry;
     $newCity = $this->newCity ? $this->newCity : ($session['top-city'] ? $session['top-city'] : $this->defaultCity);
     $session['top-location'] = $newCity;
     if ($newCountry == "international") {
         $country = 'international';
         $city = GeoCityApi::getCityByName($newCity);
         if ($city) {
             $cities = GeoCityApi::getTopPrioritiesInternational($city->id);
         } else {
             $cities = GeoCityApi::getTopPrioritiesInternational();
         }
     } else {
         $country = GeoCountryApi::getCountryByName($newCountry);
         $city = GeoCityApi::getCityByName($newCity);
         if ($country && $city) {
             $cities = GeoCityApi::getTopPrioritiesByCountry($country->id, $city->id);
         } elseif ($country) {
             $cities = GeoCityApi::getTopPrioritiesByCountry($country->id);
         }
     }
     if ($country && $cities) {
         $this->render('topLocation', array('city' => $city, 'country' => $country, 'current' => $this->current, 'cities' => $cities));
     }
     yii::endProfile('loc');
 }
開發者ID:romeo14,項目名稱:wallfeet,代碼行數:31,代碼來源:TopLocation.php

示例2: renderContent

 protected function renderContent()
 {
     yii::beginProfile('top-cities');
     $country = GeoCountryApi::getCountryByName($this->country);
     $cities = GeoCityApi::getTopPrioritiesByCountry($country->id);
     $this->render('topCities', array('cities' => $cities));
     yii::endProfile('top-cities');
 }
開發者ID:romeo14,項目名稱:wallfeet,代碼行數:8,代碼來源:TopCities.php

示例3:

<?php

/**
 * Created by PhpStorm.
 * User: x.guo
 * Date: 2016/4/4
 * Time: 18:18
 */
use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\Menu;
use yii\widgets\Breadcrumbs;
use frontend\assets\FrontendAsset;
yii::beginProfile('mainAsset', 'gx');
FrontendAsset::register($this);
yii::endProfile('mainAsset', 'gx');
$this->title = 'admin';
$baseUrl = Yii::getAlias('@web');
?>

<?php 
$this->beginPage();
?>

    <!DOCTYPE html>
    <html lang="<?php 
echo Yii::$app->language;
?>
">

    <head>
開發者ID:xidiao,項目名稱:gxfenxi,代碼行數:31,代碼來源:adminlte_main.php


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