-
Notifications
You must be signed in to change notification settings - Fork 718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support: looking a way to get smarty parse tree #364
Comments
I don't quite understand, why YOU want to parse Smarty template? |
see related links in this issue. i need can you provide example how to get same result with plugin? what is plugin anyway? any docs? |
Please read http://xyproblem.info/ before answering my question. |
looks like you never visited any links given. sad. smarty-gettext has tool named tsmarty2c (manual: tsmarty2c.1), which uses regexps to scan templates for the translations. there are several bugs and features requested (#1, #15, #20) which i tried to solve with some code refactoring but decided that that i'll be doing it wrong inventing all moving parts myself and rather use existing components. so a new project was porn: smarty-gettext/tsmarty2c, which attempts to do this properly, using parser not regexp. initial 0.1.0 release target can be seen from the ticket: #1 |
Why should I visit any links? I asked YOU, what YOU want to do with this information. |
indeed, you shouldn't do anything, you're just trolling me, not helping anybody. the links provide extra information what you may be searching for. for the implementation i provided enough information in initial issue description. |
I'm searching for information I asked you to provide. |
what i want is described in initial description: #364 (comment) if you're unable to help (you are not maintainer!), just stop posting there. thank you. |
That answers "how" not "what". See http://xyproblem.info/ |
Hi @glensc, I see what you were trying to do here and it seems you've already been able to do so on your own. Good job. I don't see a clear use case here for Smarty other than what you have been doing, so closing this issue now. |
@wisskid, it's a hackish one, mostly works, but unfortunately, it doesn't solve all scenarios needed, i.e when template uses variable assignments and that result inside |
I'm looking a way to get tokens from smarty, something similar to
getTags(), but with other tokens as well like text nodes.
The intention is to write external parser to extract
{t attrib="123" attr2='foo bar'}text here{/t}
as tokens by smarty own parser, instead of using regexps on source template file.Here's example how
getTags
is being used good way externally:https://github.com/geekwright/Po/blob/v1.0.4/src/PoInitSmarty.php#L189-L218
however that solution does not apply to me because i need the TEXT element from between
t
andtclose
notes.The text was updated successfully, but these errors were encountered: