Closed SerginhoLD closed 7 years ago
Please report any issues in English.
Как все трудно..
Google translate:
1) Replace the $this->templatePath at $ this->getTemplatePath(), etc. For example:
public function __construct($templatePath, array $attributes = [])
{
$this->setTemplatePath($templatePath);
$this->setAttributes($attributes);
}
It is necessary to inherit PhpRenderer class, now it is pointless to have to rewrite all
2) Remove \InvalidArgumentException("Duplicate template key found") in the fetch() method. Correct protectedIncludeScope:
protected function protectedIncludeScope($template, array $data) {
extract($data, EXTR_SKIP); // fix
include $template;
}
3) PhpRenderer Inherit from class \ArrayObject and remove features that use the $attributes. (It also uses an interface \ ArrayAccess, https://github.com/slimphp/Twig-View/)
1) Заменить $this->templatePath на $this->getTemplatePath() и т.п. Например:
Это очень важно для наследования класса, сейчас это бессмысленно, все равно все переписывать
2) Убрать \InvalidArgumentException("Duplicate template key found") в методе fetch(). Исправить protectedIncludeScope:
3) Унаследовать PhpRenderer от \ArrayObject и выкинуть эти функции с $attributes