-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
75454a0
commit 41685fd
Showing
2 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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']]; | ||
} | ||
|
||
} |