Skip to content

Commit

Permalink
fixed to use Twig_Loader_Array <- deprecated Twig_Loader_String
Browse files Browse the repository at this point in the history
  • Loading branch information
hiqsol committed Nov 8, 2017
1 parent 82fc5ad commit 85e2882
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/Readme.php
Expand Up @@ -183,7 +183,9 @@ public function renderBadges()
*/
public function renderBadge($template)
{
return $this->getTwig()->render($template, ['app' => Yii::$app]);
$tpl = $this->getTwig()->createTemplate($template);

return $tpl->render(['app' => Yii::$app]);
}

/**
Expand All @@ -193,7 +195,7 @@ public function renderBadge($template)
public function getTwig()
{
if ($this->_twig === null) {
$this->_twig = new \Twig_Environment(new \Twig_Loader_String());
$this->_twig = new \Twig_Environment(new \Twig_Loader_Array());
}

return $this->_twig;
Expand Down

0 comments on commit 85e2882

Please sign in to comment.