Skip to content
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 for multiple @{name} helpers #97

Open
ETNOL opened this issue Jan 27, 2016 · 1 comment
Open

Support for multiple @{name} helpers #97

ETNOL opened this issue Jan 27, 2016 · 1 comment

Comments

@ETNOL
Copy link

ETNOL commented Jan 27, 2016

I'm trying to use vash to render cshtml files. I'm having decent luck after extending the helpers as needed but I'm stuck on rendering the @Helper () { } methods in my razor files.

Is there a not-so-painful way to create another @{namespace} like @html that acts as like razor's @Helper?

I know this isn't vash's intended use but, since I'm pretty close to pulling it off, I figured I'd ask if this was possible.

@kirbysayshi
Copy link
Owner

It's currently not possible to have multiple internal namespaces for a template, since that is defined all the way from the config, through the compiler, and even in the runtime / linker. But you could hack this with some sort of globals, I suppose. But that sounds pretty hacky.

You might be better off preprocessing your cshtml files with a regex that replaces the @helper keyword with an assignment to a global namespace?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants