Fakerino\Core\Template\TemplateInterface::loadTemplate PHP Method

loadTemplate() public method

public loadTemplate ( string $template ) : boolean
$template string
return boolean
    public function loadTemplate($template);

Usage Example

Beispiel #1
0
 /**
  * Fakes a template file.
  *
  * @param string $file
  *
  * @return string
  */
 public function fakeTemplate($file)
 {
     $this->template->loadTemplate($file);
     $varsName = $this->template->getVariables();
     $out = '';
     $num = $this->num;
     for ($i = 0; $i < $num; $i++) {
         $fakeData = $this->num(1)->fake($varsName)->toArray();
         $data = array_combine(array_values($varsName), $fakeData);
         $out .= $this->template->render($data);
     }
     return $out;
 }