render() public method

render the javascript variables
Since: 3.0.0
public render ( string $key = null, mixed $value = null ) : string
$key string
$value mixed
return string
Example #1
0
 /**
  * testRender
  *
  * @since 3.0.0
  *
  * @param array $transportArray
  * @param string $expect
  *
  * @dataProvider providerRender
  */
 public function testRender($transportArray = [], $expect = null)
 {
     /* setup */
     $transport = new Assetic\Transport($this->_registry, $this->_language);
     /* actual */
     $actual = $transport->render($transportArray['key'], $transportArray['value']);
     /* compare */
     $this->assertEquals($expect, $actual);
 }
Example #2
0
 /**
  * transport javascript variables
  *
  * @since 3.0.0
  *
  * @param string $key
  * @param mixed $value
  *
  * @return Script
  */
 public function transportVar($key = null, $value = null)
 {
     $transport = new Assetic\Transport(Registry::getInstance(), Language::getInstance());
     $inline = $transport->render($key, $value);
     $this->appendInline($inline);
     return $this;
 }