protected function make($filenames, $template = 'base.php.twig', array $options = array())
	  {
	      foreach ((array) $filenames as $filename)
				{
	          if (! $this->getOption('force') && $this->fs->exists($filename))
						{
	              throw new \RuntimeException(sprintf('Cannot duplicate %s', $filename));
	          }

	          $reflection = new \ReflectionClass(get_class($this));

	          if ($reflection->getShortName() === 'Migration')
						{
	              $this->twig->addFunction(new \Twig_SimpleFunction('argument',
                  function ($field = "") {
		                return array_combine(array('name','type'), explode(':', $field));
		              }
                ));

	              foreach ($this->getArgument('options') as $option)
								{
	                  list($key, $value) = explode(':', $option);
	                  $options[$key] = $value;
	              }
	          }

            $output = $this->twig->loadTemplate($template)->render($options);

	          $this->fs->dumpFile($filename, $output);
	      }
	      return true;
	  }
protected function make($filenames, $template = 'base.php.twig', array $options = array())
	  {
	      foreach ((array) $filenames as $filename)
				{
	          if (! $this->getOption('force') && $this->fs->exists($filename))
						{
	              throw new \RuntimeException(sprintf('Cannot duplicate %s', $filename));
	          }

	          $reflection = new \ReflectionClass(get_class($this));

	          if ($reflection->getShortName() === 'Migration')
						{
	              $this->twig->addFunction(new \Twig_SimpleFunction('argument',
                  function ($field = "") {
		                return array_combine(array('name','type'), explode(':', $field));
		              }
                ));

	              foreach ($this->getArgument('options') as $option)
								{
	                  list($key, $value) = explode(':', $option);
	                  $options[$key] = $value;
	              }
	          }

            $output = $this->twig->loadTemplate($template)->render($options);

	          $this->fs->dumpFile($filename, $output);
	      }
	      return true;
	  }
protected function make ( $ filenames , $ template = 'base.php.twig' , array $ options = array ( ) ) { foreach ( ( array ) $ filenames as $ filename ) { if ( ! $ this -> getOption ( 'force' ) && $ this -> fs -> exists ( $ filename ) ) { throw new \ RuntimeException ( sprintf ( 'Cannot duplicate %s' , $ filename ) ) ; } $ reflection = new \ ReflectionClass ( get_class ( $ this ) ) ; if ( $ reflection -> getShortName ( ) === 'Migration' ) { $ this -> twig -> addFunction ( new \ Twig_SimpleFunction ( 'argument' , function ( $ field = "" ) { return array_combine ( array ( 'name' , 'type' ) , explode ( ':' , $ field ) ) ; } ) ) ; foreach ( $ this -> getArgument ( 'options' ) as $ option ) { list ( $ key , $ value ) = explode ( ':' , $ option ) ; $ options [ $ key ] = $ value ; } } $ output = $ this -> twig -> loadTemplate ( $ template ) -> render ( $ options ) ; $ this -> fs -> dumpFile ( $ filename , $ output ) ; } return true ; }
Generate files based on templates.

@param  mixed  $filenames The file to be written to
@param  mixed  $paths     The Twig_Loader_Filesystem template path
@param  array  $options   The data to write into the file
@param  string $template  The template file
@return bool              Returns true if the file has been created
Generate files based on templates .