本文整理汇总了PHP中Piwik_Date::getLocalized方法的典型用法代码示例。如果您正苦于以下问题:PHP Piwik_Date::getLocalized方法的具体用法?PHP Piwik_Date::getLocalized怎么用?PHP Piwik_Date::getLocalized使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik_Date
的用法示例。
在下文中一共展示了Piwik_Date::getLocalized方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setGeneralVariablesView
protected function setGeneralVariablesView($view)
{
// date
$view->date = $this->strDate;
$oDate = new Piwik_Date($this->strDate);
$view->prettyDate = $oDate->getLocalized(Piwik_Translate('Home_LocalizedDateFormat'));
// period
$currentPeriod = Piwik_Common::getRequestVar('period');
$otherPeriodsAvailable = array('day', 'week', 'month', 'year');
$otherPeriodsNames = array('day' => Piwik_Translate('Home_PeriodDay'), 'week' => Piwik_Translate('Home_PeriodWeek'), 'month' => Piwik_Translate('Home_PeriodMonth'), 'year' => Piwik_Translate('Home_PeriodYear'));
$found = array_search($currentPeriod, $otherPeriodsAvailable);
if ($found !== false) {
unset($otherPeriodsAvailable[$found]);
}
$view->period = $currentPeriod;
$view->otherPeriods = $otherPeriodsAvailable;
$view->periodsNames = $otherPeriodsNames;
// other
$view->idSite = Piwik_Common::getRequestVar('idSite');
$view->userLogin = Piwik::getCurrentUserLogin();
$view->sites = Piwik_SitesManager_API::getSitesWithAtLeastViewAccess();
$view->url = Piwik_Url::getCurrentUrl();
$view->menu = Piwik_GetMenu();
$view->menuJson = json_encode($view->menu);
//var_dump($view->menuJson);
}