本文整理汇总了PHP中Piwik\View::render方法的典型用法代码示例。如果您正苦于以下问题:PHP View::render方法的具体用法?PHP View::render怎么用?PHP View::render使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik\View
的用法示例。
在下文中一共展示了View::render方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
$view = new View('@VisitTime/index');
$view->dataTableVisitInformationPerLocalTime = $this->renderReport(new GetVisitInformationPerLocalTime());
$view->dataTableVisitInformationPerServerTime = $this->renderReport(new GetVisitInformationPerServerTime());
return $view->render();
}
示例2: render
/**
* @see ViewDataTable::main()
* @return mixed
*/
public function render()
{
$view = new View('@CoreVisualizations/_dataTableViz_sparklines.twig');
$columnsList = array();
if ($this->config->hasSparklineMetrics()) {
foreach ($this->config->getSparklineMetrics() as $cols) {
$columns = $cols['columns'];
if (!is_array($columns)) {
$columns = array($columns);
}
$columnsList = array_merge($columns, $columnsList);
}
}
$view->allMetricsDocumentation = Metrics::getDefaultMetricsDocumentation();
$this->requestConfig->request_parameters_to_modify['columns'] = $columnsList;
$this->requestConfig->request_parameters_to_modify['format_metrics'] = '1';
if (!empty($this->requestConfig->apiMethodToRequestDataTable)) {
$this->fetchConfiguredSparklines();
}
$view->sparklines = $this->config->getSortedSparklines();
$view->isWidget = Common::getRequestVar('widget', 0, 'int');
$view->titleAttributes = $this->config->title_attributes;
$view->footerMessage = $this->config->show_footer_message;
$view->areSparklinesLinkable = $this->config->areSparklinesLinkable();
$view->title = '';
if ($this->config->show_title) {
$view->title = $this->config->title;
}
return $view->render();
}
示例3: getPromoVideo
/**
* Renders and echo's HTML that displays the Piwik promo video.
*/
public function getPromoVideo()
{
$view = new View('@CoreHome/getPromoVideo');
$view->shareText = $this->translator->translate('CoreHome_SharePiwikShort');
$view->shareTextLong = $this->translator->translate('CoreHome_SharePiwikLong');
$view->promoVideoUrl = 'https://www.youtube.com/watch?v=OslfF_EH81g';
return $view->render();
}
示例4: displayDbConnectionMessage
public function displayDbConnectionMessage($exception = null)
{
$view = new PiwikView("@Installation/cannotConnectToDb");
$view->exceptionMessage = $exception->getMessage();
$ex = new DatabaseConnectionFailedException($view->render());
$ex->setIsHtmlMessage();
throw $ex;
}
示例5: testJsInclude2
public function testJsInclude2()
{
$view = new View('@Widgetize/testJsInclude2');
$view->url1 = '?module=Widgetize&action=js&moduleToWidgetize=UserSettings&actionToWidgetize=getBrowser&idSite=1&period=day&date=yesterday';
$view->url2 = '?module=Widgetize&action=js&moduleToWidgetize=UserCountry&actionToWidgetize=getCountry&idSite=1&period=day&date=yesterday&viewDataTable=cloud&show_footer=0';
$view->url3 = '?module=Widgetize&action=js&moduleToWidgetize=Referrers&actionToWidgetize=getKeywords&idSite=1&period=day&date=yesterday&viewDataTable=table&show_footer=0';
return $view->render();
}
示例6: getLanguagesSelector
/**
* Renders and returns the language selector HTML.
*
* @return string
*/
public function getLanguagesSelector()
{
$view = new View("@LanguagesManager/getLanguagesSelector");
$view->languages = API::getInstance()->getAvailableLanguageNames();
$view->currentLanguageCode = self::getLanguageCodeForCurrentUser();
$view->currentLanguageName = self::getLanguageNameForCurrentUser();
return $view->render();
}
示例7: promoPiwikPro
public function promoPiwikPro()
{
$view = new View('@PiwikPro/promoPiwikProWidget');
$promo = $this->promo->getContent();
$view->ctaLinkUrl = $this->advertising->getPromoUrlForOnPremises('PromoWidget', $promo['campaignContent']);
$view->ctaText = $promo['text'];
$view->ctaLinkTitle = $this->promo->getLinkTitle();
return $view->render();
}
示例8: index
public function index()
{
$view = new View('@VisitorInterest/index');
$view->dataTableNumberOfVisitsPerVisitDuration = $this->getNumberOfVisitsPerVisitDuration(true);
$view->dataTableNumberOfVisitsPerPage = $this->getNumberOfVisitsPerPage(true);
$view->dataTableNumberOfVisitsByVisitNum = $this->getNumberOfVisitsByVisitCount(true);
$view->dataTableNumberOfVisitsByDaysSinceLast = $this->getNumberOfVisitsByDaysSinceLast(true);
return $view->render();
}
示例9: promoServices
public function promoServices()
{
$view = new View('@ProfessionalServices/promoServicesWidget');
$promo = $this->promo->getContent();
$view->ctaLinkUrl = $this->advertising->getPromoUrlForPiwikProUpgrade();
$view->ctaText = $promo['text'];
$view->ctaLinkTitle = $this->promo->getLinkTitle();
return $view->render();
}
示例10: getDatabaseSize
/**
* Echo's an HTML chunk describing the current database size, and the estimated space
* savings after the scheduled data purge is run.
*/
public function getDatabaseSize()
{
Piwik::checkUserHasSuperUserAccess();
$view = new View('@PrivacyManager/getDatabaseSize');
$forceEstimate = Common::getRequestVar('forceEstimate', 0);
$view->dbStats = $this->getDeleteDBSizeEstimate($getSettingsFromQuery = true, $forceEstimate);
$view->language = LanguagesManager::getLanguageCodeForCurrentUser();
return $view->render();
}
示例11: render
public function render()
{
$view = new View('@ProfessionalServices/promoServicesWidget');
$promo = $this->promo->getContent();
$view->ctaLinkUrl = $promo['url'];
$view->ctaText = $promo['text'];
$view->ctaLinkTitle = $this->promo->getLinkTitle();
return $view->render();
}
示例12: indexSiteSearch
public function indexSiteSearch()
{
$view = new View('@Actions/indexSiteSearch');
$view->keywords = $this->getSiteSearchKeywords(true);
$view->noResultKeywords = $this->getSiteSearchNoResultKeywords(true);
$view->pagesUrlsFollowingSiteSearch = $this->getPageUrlsFollowingSiteSearch(true);
$categoryTrackingEnabled = \Piwik\Plugin\Manager::getInstance()->isPluginActivated('CustomVariables');
if ($categoryTrackingEnabled) {
$view->categories = $this->getSiteSearchCategories(true);
}
return $view->render();
}
示例13: goalConversionsOverview
public function goalConversionsOverview()
{
$view = new View('@Goals/conversionOverview');
$idGoal = Common::getRequestVar('idGoal', null, 'string');
$view->topDimensions = $this->getTopDimensions($idGoal);
$goalMetrics = Request::processRequest('Goals.get', array('idGoal' => $idGoal));
// conversion rate for new and returning visitors
$view->conversion_rate_returning = $this->formatConversionRate($goalMetrics, 'conversion_rate_returning_visit');
$view->conversion_rate_new = $this->formatConversionRate($goalMetrics, 'conversion_rate_new_visit');
$view->idGoal = $idGoal;
return $view->render();
}
示例14: renderTemplate
/**
* Assigns the given variables to the template and renders it.
*
* Example:
*
* public function myControllerAction () {
* return $this->renderTemplate('index', array(
* 'answerToLife' => '42'
* ));
* }
*
* This will render the 'index.twig' file within the plugin templates folder and assign the view variable
* `answerToLife` to `42`.
*
* @param string $template The name of the template file. If only a name is given it will automatically use
* the template within the plugin folder. For instance 'myTemplate' will result in
* '@$pluginName/myTemplate.twig'. Alternatively you can include the full path:
* '@anyOtherFolder/otherTemplate'. The trailing '.twig' is not needed.
* @param array $variables For instance array('myViewVar' => 'myValue'). In template you can use {{ myViewVar }}
* @return string
* @api
*/
protected function renderTemplate($template, array $variables = array())
{
if (false === strpos($template, '@') || false === strpos($template, '/')) {
$aPluginName = explode('\\', get_class($this));
$aPluginName = $aPluginName[2];
$template = '@' . $aPluginName . '/' . $template;
}
$view = new View($template);
foreach ($variables as $key => $value) {
$view->{$key} = $value;
}
return $view->render();
}
示例15: render
public function render()
{
$lastMinutes = Config::getInstance()->General[Controller::SIMPLE_VISIT_COUNT_WIDGET_LAST_MINUTES_CONFIG_KEY];
$lastNData = Request::processRequest('Live.getCounters', array('lastMinutes' => $lastMinutes));
$view = new View('@Live/getSimpleLastVisitCount');
$view->lastMinutes = $lastMinutes;
$view->visitors = MetricsFormatter::getPrettyNumber($lastNData[0]['visitors']);
$view->visits = MetricsFormatter::getPrettyNumber($lastNData[0]['visits']);
$view->actions = MetricsFormatter::getPrettyNumber($lastNData[0]['actions']);
$view->refreshAfterXSecs = Config::getInstance()->General['live_widget_refresh_after_seconds'];
$view->translations = array('one_visitor' => Piwik::translate('Live_NbVisitor'), 'visitors' => Piwik::translate('Live_NbVisitors'), 'one_visit' => Piwik::translate('General_OneVisit'), 'visits' => Piwik::translate('General_NVisits'), 'one_action' => Piwik::translate('General_OneAction'), 'actions' => Piwik::translate('VisitsSummary_NbActionsDescription'), 'one_minute' => Piwik::translate('General_OneMinute'), 'minutes' => Piwik::translate('General_NMinutes'));
return $view->render();
}