Skip to content

Commit

Permalink
Further twig refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Jul 18, 2016
1 parent 75454a0 commit 41685fd
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@

namespace Spryker\Shared\Twig;

class TwigSimpleFilter extends \Twig_SimpleFilter {
class TwigFilter extends \Twig_SimpleFilter {
}
36 changes: 36 additions & 0 deletions src/Spryker/Shared/Twig/TwigFunction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

/**
* Copyright © 2016-present Spryker Systems GmbH. All rights reserved.
* Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
*/

namespace Spryker\Shared\Twig;

abstract class TwigFunction extends \Twig_SimpleFunction
{

public function __construct()
{
parent::__construct($this->getFunctionName(), $this->getFunction(), $this->getOptions());
}

/**
* @return string
*/
abstract protected function getFunctionName();

/**
* @return callable
*/
abstract protected function getFunction();

/**
* @return array
*/
protected function getOptions()
{
return ['is_safe' => ['html']];
}

}

0 comments on commit 41685fd

Please sign in to comment.