The main purpose of this class is to provide the view model with the App instance, thus giving it access to the various helper methods available in that class. Additionally, it provides an instance of Escaper, allowing you to do context-specific escaping within helpers you define in the view model.
Пример #1
0
 public function testCanPassEscaperInstanceToConstructor()
 {
     $escaper = new Escaper();
     $model = new MustacheViewModel($this->app, $escaper);
     $this->assertSame($escaper, $model->__escaper());
 }