Add basic smarty templating support
See original GitHub issueI am using js-beautify
to format smarty
files. It would be helpful if I can extend/modify the Tokenizer
prototype. I’ve noticed that the module is not exported. Is there some other way to do it?
I am seeking for an API to extend the Tokenizer
functions.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Smarty Template Support - Visual Studio Marketplace
Extension for Visual Studio Code - Smarty template support with formatting, folding, snippets, syntax highlighting and more.
Read more >Chapter 3. Basic Syntax - Smarty Template Engine
In Smarty, all content outside of delimiters is displayed as static content, or unchanged. When Smarty encounters template tags, it attempts to interpret ......
Read more >Get Started with Smarty Syntax - Cordial Knowledge Base
Cordial's template syntax is built on Smarty (a PHP based template language). It is a very powerful scripting language that can be used...
Read more >Smarty PHP Template Engine in Visual Studio - YouTube
This video quickly guides you through the Smarty template engine and how the PHP Tools plugin helps you use it.
Read more >Template Engine Basics - PHP Smarty - YouTube
This shows how to get started with PHP Smarty.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
To be clear, you should be able to get the basic behavior you want if you take the start and end regular expressions you have here and integrate them into
templatablepattern.js
. This would prevent smarty tags from getting mangled.@aswinkumar863
You need to at least run
make js
on your fork. If you commit thelib
folder, then you might be able to runnpm install myusername/repo#branchName
. But as I said that is not what I would suggest.Also, I looked at the changes in your fork. I would suggest you make changes in templatablepattern.js instead of adding the while loops. That class handles template tokenizing for the entire beautifier. Adding the smarty templating to it should get you exactly what you’re looking for.
Give it a try and if you run into problems, come over to the gitter.im channel and I’ll be happy to answer questions.