本文整理汇总了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');
}
示例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');
}
示例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>