Piwik\View::__construct PHP Метод

__construct() публичный Метод

Constructor.
public __construct ( string $templateFile )
$templateFile string The template file to load. Must be in the following format: `"@MyPlugin/templateFileName"`. Note the absence of .twig from the end of the name.
    public function __construct($templateFile)
    {
        $templateExt = '.twig';
        if (substr($templateFile, -strlen($templateExt)) !== $templateExt) {
            $templateFile .= $templateExt;
        }
        $this->template = $templateFile;
        $this->initializeTwig();
        $this->piwik_version = Version::VERSION;
        $this->userLogin = Piwik::getCurrentUserLogin();
        $this->isSuperUser = Access::getInstance()->hasSuperUserAccess();
        try {
            $this->piwikUrl = SettingsPiwik::getPiwikUrl();
        } catch (Exception $ex) {
            // pass (occurs when DB cannot be connected to, perhaps piwik URL cache should be stored in config file...)
        }
    }

Usage Example

Пример #1
0
 public function __construct($subtemplatePath, $installationSteps, $currentStepName)
 {
     parent::__construct($subtemplatePath);
     $this->steps = array_keys($installationSteps);
     $this->allStepsTitle = array_values($installationSteps);
     $this->currentStepName = $currentStepName;
     $this->showNextStep = false;
 }
All Usage Examples Of Piwik\View::__construct