Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/Application/UI/Presenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,15 @@ public function run(Application\Request $request): Application\IResponse
}

$this->initGlobalParameters();
$this->checkRequirements($this->getReflection());
$this->checkRequirements(static::getReflection());
$this->onStartup($this);
$this->startup();
if (!$this->startupCheck) {
$class = $this->getReflection()->getMethod('startup')->getDeclaringClass()->getName();
$class = static::getReflection()->getMethod('startup')->getDeclaringClass()->getName();
throw new Nette\InvalidStateException("Method $class::startup() or its descendant doesn't call parent::startup().");
}
// calls $this->action<Action>()
$this->tryCall($this->formatActionMethod($this->action), $this->params);
$this->tryCall(static::formatActionMethod($this->action), $this->params);

// autoload components
foreach ($this->globalParams as $id => $foo) {
Expand All @@ -218,7 +218,7 @@ public function run(Application\Request $request): Application\IResponse
$this->beforeRender();
$this->onRender($this);
// calls $this->render<View>()
$this->tryCall($this->formatRenderMethod($this->view), $this->params);
$this->tryCall(static::formatRenderMethod($this->view), $this->params);
$this->afterRender();

// save component tree persistent state
Expand Down Expand Up @@ -506,7 +506,7 @@ public function formatLayoutTemplateFiles(): array
}
[$module, $presenter] = Helpers::splitName($this->getName());
$layout = $this->layout ?: 'layout';
$dir = dirname($this->getReflection()->getFileName());
$dir = dirname(static::getReflection()->getFileName());
$dir = is_dir("$dir/templates") ? $dir : dirname($dir);
$list = [
"$dir/templates/$presenter/@$layout.latte",
Expand All @@ -526,7 +526,7 @@ public function formatLayoutTemplateFiles(): array
public function formatTemplateFiles(): array
{
[, $presenter] = Helpers::splitName($this->getName());
$dir = dirname($this->getReflection()->getFileName());
$dir = dirname(static::getReflection()->getFileName());
$dir = is_dir("$dir/templates") ? $dir : dirname($dir);
return [
"$dir/templates/$presenter/$this->view.latte",
Expand Down Expand Up @@ -740,7 +740,7 @@ final protected function createRequest(Component $component, string $destination

$this->lastCreatedRequest = $this->lastCreatedRequestFlag = null;

$parts = $this->parseDestination($destination);
$parts = static::parseDestination($destination);
$path = $parts['path'];
$args = $parts['args'] ?? $args;

Expand Down Expand Up @@ -1151,7 +1151,7 @@ protected function getGlobalState(string $forClass = null): array
*/
public function saveState(array &$params, ComponentReflection $reflection = null): void
{
($reflection ?: $this->getReflection())->saveState($this, $params);
($reflection ?: static::getReflection())->saveState($this, $params);
}


Expand Down