factory = $factory; $this->tag = $tag; $this->output = $output; $this->single = $single; $this->extensions = $extensions; } public function parse(\Twig_Token $token) { $inputs = array(); $filters = array(); $name = null; $attributes = array( 'output' => $this->output, 'var_name' => 'asset_url', ); $stream = $this->parser->getStream(); while (!$stream->test(\Twig_Token::BLOCK_END_TYPE)) { if ($stream->test(\Twig_Token::STRING_TYPE)) { // '@jquery', 'js/src/core/*', 'js/src/extra.js' $inputs[] = $stream->next()->getValue(); } elseif ($stream->test(\Twig_Token::NAME_TYPE, 'filter')) { // filter='yui_js' $stream->next(); $stream->expect(\Twig_Token::OPERATOR_TYPE, '='); $filters = array_merge($filters, array_filter(array_map('trim', explode(',', $stream->expect(\Twig_Token::STRING_TYPE)->getValue())))); } elseif ($stream->test(\Twig_Token::NAME_TYPE, 'output')) { // output='js/packed/*.js' OR output='js/core.js' $stream->next(); $stream->expect(\Twig_Token::OPERATOR_TYPE, '='); $attributes['output'] = $stream->expect(\Twig_Token::STRING_TYPE)->getValue(); } elseif ($stream->test(\Twig_Token::NAME_TYPE, 'name')) { // name='core_js' $stream->next(); $stream->expect(\Twig_Token::OPERATOR_TYPE, '='); $name = $stream->expect(\Twig_Token::STRING_TYPE)->getValue(); } elseif ($stream->test(\Twig_Token::NAME_TYPE, 'as')) { // as='the_url' $stream->next(); $stream->expect(\Twig_Token::OPERATOR_TYPE, '='); $attributes['var_name'] = $stream->expect(\Twig_Token::STRING_TYPE)->getValue(); } elseif ($stream->test(\Twig_Token::NAME_TYPE, 'debug')) { // debug=true $stream->next(); $stream->expect(\Twig_Token::OPERATOR_TYPE, '='); $attributes['debug'] = 'true' == $stream->expect(\Twig_Token::NAME_TYPE, array('true', 'false'))->getValue(); } elseif ($stream->test(\Twig_Token::NAME_TYPE, 'combine')) { // combine=true $stream->next(); $stream->expect(\Twig_Token::OPERATOR_TYPE, '='); $attributes['combine'] = 'true' == $stream->expect(\Twig_Token::NAME_TYPE, array('true', 'false'))->getValue(); } elseif ($stream->test(\Twig_Token::NAME_TYPE, $this->extensions)) { // an arbitrary configured attribute $key = $stream->next()->getValue(); $stream->expect(\Twig_Token::OPERATOR_TYPE, '='); $attributes[$key] = $stream->expect(\Twig_Token::STRING_TYPE)->getValue(); } else { $token = $stream->getCurrent(); throw new \Twig_Error_Syntax(sprintf('Unexpected token "%s" of value "%s"', \Twig_Token::typeToEnglish($token->getType(), $token->getLine()), $token->getValue()), $token->getLine()); } } $stream->expect(\Twig_Token::BLOCK_END_TYPE); $body = $this->parser->subparse(array($this, 'testEndTag'), true); $stream->expect(\Twig_Token::BLOCK_END_TYPE); if ($this->single && 1 < count($inputs)) { $inputs = array_slice($inputs, -1); } if (!$name) { $name = $this->factory->generateAssetName($inputs, $filters, $attributes); } $asset = $this->factory->createAsset($inputs, $filters, $attributes + array('name' => $name)); return $this->createNode($asset, $body, $inputs, $filters, $name, $attributes, $token->getLine(), $this->getTag()); } public function getTag() { return $this->tag; } public function testEndTag(\Twig_Token $token) { return $token->test(array('end'.$this->getTag())); } protected function createNode( AssetInterface $asset, \Twig_NodeInterface $body, array $inputs, array $filters, $name, array $attributes = array(), $lineno = 0, $tag = null, ) { return new AsseticNode($asset, $body, $inputs, $filters, $name, $attributes, $lineno, $tag); } } __halt_compiler();----SIGNATURE:----bRmvdY8t9C0pIy93xT8iwCl3A6CZPDHJyiMmkylnGUwgBsD7PIQS7ZXuc9GzfeApZXembQHC5XHtN3kn8EtLemp9lhEWAelH3YIS+BrOfzKNPzTYaa1ILtwkuq14C2EgQX5OOgilTRLA50JyW6Hrj3TSe4AKAPwVL0FBHxgzGp2jF6r20cjvPbPXpvJcfehMAOy6CLyJy4pHpJZaavOyQ2LfKETYHiLPKQxdDH4aHkDUoZllibdMUmtwzDQjMsVKv0Fh0F0anfqbpP7bEdyHK60MbgmbchpC80PSSPH8gabJSncOdsL/+Z3uO/ihOk+o0Was5L9e8GxK0aMXc5orTMS5hxMAhhhHiy4JzUfO5ENudAEKyNpTQztucEqPRJDI5Zz0tWYZv6Gv14Ug/JDBOY997gXksqfJfc1n7lglyGfzah75hCk2fMBLL1RutsnJMzHv3KQnBjhJVDNOHmCi1+PRmx4WlgFRX3AFoPB0SWayHouVUtyDw0wr7OIhdEZ1OUxcheemCfL7Zcamek/aVhBmVYHmczt8iTpKFonAz9LYLrY6yVcPuF5/Mpf0dYdm/4hfyqLfb27yWYlr0LGDBHYtaFSTF1B9caeXJmcVWT4knFQ0ZnrLhpctwWjLw9vlwqIH7uV7ApxGI+r5fH6RhxcERO6PhT14PrbAZis4ka4=----ATTACHMENT:----MjA1NDA5NzkyMjU2NTkxMCAzMDAzMzUyODAyNjIzNTIgMjI1NTkyNjU3MzEyMDU3Mg==