+ //Set name in context key
+ $ref = new AssignNameExpression($name, $token->getLine());
+
+ //Set output in context value
+ $value = new TextNode($outputUrl, $token->getLine());
+
+ //Send body with context set
+ return new Node([
+ //This define name in twig template by prepending $context['<name>'] = '<output>';
+ new SetNode(true, $ref, $value, $token->getLine(), $this->getTag()),
+ //The tag captured body
+ $body
+ ]);
+ }
+
+ /**
+ * Test for tag end
+ *
+ * @param Token token The \Twig\Token instance
+ *
+ * @return bool
+ */
+ public function testEndTag(Token $token) {
+ return $token->test(['end'.$this->getTag()]);
+ }
+
+ /**
+ * Get path from bundled file
+ *
+ * @param string file The bundled file path
+ * @param int lineno The template line where the error occurred
+ * @param Source source The source context where the error occurred
+ * @param \Exception prev The previous exception
+ *
+ * @return string The resolved file path
+ *
+ * @todo Try retrive public dir from the member function BundleNameBundle::getPublicDir() return value ?
+ * @xxx see https://symfony.com/doc/current/bundles.html#overridding-the-bundle-directory-structure
+ */
+ public function getLocated($file, int $lineno = 0, Source $source = null, \Exception $prev = null) {
+ /*TODO: add a @jquery magic feature ?
+ if ($file == '@jquery') {
+ #header('Content-Type: text/plain');
+ #var_dump($inputs);
+ #exit;
+ return $this->config['jquery'];
+ }*/