【发布时间】:2015-05-25 16:48:53
【问题描述】:
我在this question 中几乎解决了我的问题。现在我必须找到一种方法来覆盖默认的刀片转义功能。 我认为有一种方法可以创建一个类来扩展和覆盖 BladeCompiler 类的行为,这样我就可以做出这样的事情:
class MyCustomCompiler extends BladeCompiler{
function compileEscapedEchos($value){
return parent::compileEscapedEchos(utf8_encode($value));
}
}
如果我能做到,我只需要让 laravel 使用 MyCustomCompiler 而不是 BladeCompiler。我该怎么做?
【问题讨论】:
标签: php dependency-injection laravel-5