Beispiel #1
0
 public function testSetViewPaths()
 {
     $factory = new ChickenCoder\ArrayView\Factory();
     $this->assertEquals([], $factory->getViewPaths());
     $factory->setViewPaths([__DIR__]);
     $this->assertEquals([__DIR__], $factory->getViewPaths());
 }
Beispiel #2
0
 /**
  * Get the evaluated view contents for the given view.
  *
  * @param  string  $view
  * @param  array   $data
  * @param  array   $mergeData
  * @return \ChickenCoder\ArrayView\Factory
  */
 function arrayView($view = null, $data = [], $mergeData = [])
 {
     static $factory;
     if ($factory == null) {
         $viewPaths = [dirname(__FILE__) . '/views'];
         $factory = new \ChickenCoder\ArrayView\Factory($viewPaths);
     }
     if (func_num_args() === 0) {
         return $factory;
     }
     return $factory->render($view, $data, $mergeData);
 }