ciscoheat / erazor Goto Github PK
View Code? Open in Web Editor NEWA Haxe implementation of the Razor view engine
A Haxe implementation of the Razor view engine
is there any method available by which i can change the delimiter from @ to <% and %>
that is, instead of
var s = new Template("Hello, @name!").execute({name:"World"});
i may be able to process this:
var s = new Template("Hello, <%=name%>!").execute({name:"World"});
Currently, while I like a lot and use erazor daily in my own projects, I feel that we lack a little direction or ownership about it at the moment.
Can we use this issue to discuss that? I'd like to implement some extra features, and work on a better way to deal with escaping/raw, templating in general (following how razor does it), and better support for erazor macros. If no-one oposes to that, I propose that we release our current version as erazor 1.0, and start working on erazor 2.0 with these extra features - maybe breaking backwards compatibility.
It would be great to add a way (maybe even default it) to add a escape function (e.g. htmlEscape) for the variable output, as not adding it opens up some possible security holes.
It is a feature request, that is to allow nested {} appear inside a template.
I'm using erazor to generate haxe source code, which as you can imagine there are lots of {} inside the template. Currently to escape it, I use @("}")
, which is ugly and hard to type.
I think it is safe to accept {} inside template by counting the number of {
and }
, because normally they come in pair (independent of context). Only use @("}")
to escape single {
or }
is better, since it is rarer.
i'm getting an error using erazor macros...
"/erazor/macro/Build.hx:281: lines 281-398 : Some constructors are not matched : EMacro"
"\erazor\src/erazor/macro/Template.hx:8: characters 2-11 : Build failure"
"src/server/Index.hx:20: characters 15-32 : src.server.view.IndexView has no field execute"
there is no way to comment stuff in templates..
//@popopo or is still parsed as a possible block !.
perhaps at least :
@ignore (){
<img src="path/@popop" />
}
<img src="path/@pipip" />
..
Running tests on PHP target causes exceptions:
erazor.TestSimpleMacro test_Block_with_enum_match: ERROR E call_user_func_array() expects parameter 1 to be a valid callback, no array or string given (errno: 2) in /home/dev/workspace-haxe/erazor/bin/TestAll/lib/erazor/macro/Template.class.php at line #5 (...)
It seems dynamic function 'escape' in erazor.macro.Template is never initialized.
Am I the only one seeing these issues (there're more failed tests on other targets)?
Hi guys ! i recently noticed that haxe Statics like Math or Std doesnt work (at least for macros).
i ran the test to verify and it doesnt pass !!
(..) /test/erazor/TestMacro.hx:123: character 10 : { x : Float } has no field Math
even putting the typedef as Dynamic i get the same error.
Is it a non-feature, a known bug ? are there some solutions using Helpers or what ?
thx
hello when assigning a basic mail adress ( obviously containing a @ )in a content .
Erazor fail to ignore it .. it' s looking for a variable named pop.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.