template-engine

Can NHaml be used as a general purpose template engine? (outside of MVC)

前提是你 提交于 2019-12-01 19:53:13
I've seen a lot of people that like using the NHaml View Engine in ASP.NET MVC, but I'm wondering if NHaml can be used as a general purpose templating engine in .NET ? I'd like to use NHaml from a Console application, or to generate HTML email templates, outside of the ASP MVC View Engine environment. Is this possible? I haven't found many code examples anywhere showing how to do this. Thanks! Yes, it can be used without ASP.Net MVC. I use it for my own web server (but that doesn't mean that you HAVE to use it with web servers). Check out how I use it here: http://webserver.codeplex.com

Client Side Template with view per role

江枫思渺然 提交于 2019-12-01 19:41:02
I've been reading about AngularJS and it seems very promising, the only thing I'm trying to figure out, not specific for framework, but it's general for client-side template. Let's say you have a web application with multiple roles, each role may contain addition feature,,, so you cannot have different template for each role, that would be considered bad practice, so my question is what's the best approach to use client-side template in the mean time, not exposing your template to client, so for example, in AngularJS I don't have to use ng-show ? What best tool to generate template at server

Dynamic Dropdown in Node.js

烈酒焚心 提交于 2019-12-01 14:11:07
Newbie to Node.js here: What is an easy way to make dynamic dropdowns in node.js? Basically, I have two tables: Skill and Skill_Category . I want to select from the Skill_Category and be presented with the associated Skill . I would assume I would need to use some template engine (to render in a webpage). I tried researching a good amount on google, but didn't turn up anything that helped me. If anyone can point me in the right direction? Thank you! So one dropdown will cause the other to show. Unless the second dropdown has hundreds of options you won't want to make a separate server side

knockoutjs container less template inside SELECT, foreach OPTION not working with Internet Explorer

偶尔善良 提交于 2019-12-01 13:16:59
I have an quiz/survey application and I'm having problems populating a dropdown list using knockoutjs. Please check this fiddle with Firefox (or Chrome), then try it with Internet Explorer 9 (or IE8, or IE7... knockout says to be compatible from IE6+ but obviously IE gives some problems in my scenario). In Firefox and Chrome my jsfiddle example works , but not with Internet Explorer. See in thab 1, last question "Where do you live?" and in tab 2, "Favorite sport?". The dropdown is not populated in IE. I suspect that something is not working well with $parent, or $parent.ParticipantAnswer ==

Chrome extension: Uncaught Error: Code generation from strings disallowed for this context

烈酒焚心 提交于 2019-12-01 08:39:42
I am trying to use micro template engine in chrome extension and getting the following error : Uncaught Error: Code generation from strings disallowed for this context while parsing the template. Can you help me fixing this? Manifest.json manifest.json: { "name": "YYYY", "version": "1.0", "manifest_version": 2, "description": "The first extension that I made.", "browser_action": { "default_icon": "icon.ico", "default_popup": "popup.html" } } popup.html: <!doctype html> <html ng-csp ng-app> <head> <title>Getting Started Extension's Popup</title> <style> body { min-width:357px; overflow-x:hidden

Smarty (and other tpl ngins): assign and assign_by_ref

岁酱吖の 提交于 2019-12-01 08:07:30
This is not just about Smarty, but I guess most template engines that have variables assigned. It's more a theoretical question, than a practical. I have no use case. What happens in PHP when you assign a big array $a to another variable $b ? PHP copies the array? Maybe, just maybe, internally it creates a pointer. Then what happens when you alter $a slightly? $b shouldn't be changed, because no & was used to create $b . Did PHP just double the memory usage?? More specifically: What happens when you assign a big array from you Controller ( $a ) to your template engine ( $tpl->vars['a'] ) and

Smarty (and other tpl ngins): assign and assign_by_ref

ぐ巨炮叔叔 提交于 2019-12-01 06:47:23
问题 This is not just about Smarty, but I guess most template engines that have variables assigned. It's more a theoretical question, than a practical. I have no use case. What happens in PHP when you assign a big array $a to another variable $b ? PHP copies the array? Maybe, just maybe, internally it creates a pointer. Then what happens when you alter $a slightly? $b shouldn't be changed, because no & was used to create $b . Did PHP just double the memory usage?? More specifically: What happens

Chrome extension: Uncaught Error: Code generation from strings disallowed for this context

大憨熊 提交于 2019-12-01 06:30:40
问题 I am trying to use micro template engine in chrome extension and getting the following error : Uncaught Error: Code generation from strings disallowed for this context while parsing the template. Can you help me fixing this? Manifest.json manifest.json: { "name": "YYYY", "version": "1.0", "manifest_version": 2, "description": "The first extension that I made.", "browser_action": { "default_icon": "icon.ico", "default_popup": "popup.html" } } popup.html: <!doctype html> <html ng-csp ng-app>

In Ansible, how can I combine a default dictionary in a role with a dictionary passed to that role as an argument?

做~自己de王妃 提交于 2019-12-01 06:06:32
In Ansible , how can I combine a default dictionary in a role with a dictionary passed to that role as an argument? As a solution by example, consider role nginx-reverse-proxy : nginx-reverse-proxy/defaults/main.yml : default_nginx: application_context: /{{ application_name }}-{{ application_component_name }} reverse_proxy: port: 8080 nginx-reverse-proxy/templates/reverse-proxy.conf : {% set combined_nginx = default_nginx | combine(nginx, recursive=true) -%} location {{ combined_nginx.application_context }} { proxy_pass http://localhost:{{ combined_nginx.reverse_proxy.port }}; proxy_set_header

How do I add Thymeleaf SpringSecurityDialect to spring boot

ε祈祈猫儿з 提交于 2019-12-01 05:31:08
In the configuration of my template engine I would like to add SpringSecurityDialect() like: @Bean public TemplateEngine templateEngine() { SpringTemplateEngine engine = new SpringTemplateEngine(); engine.addDialect(new SpringSecurityDialect()); engine.setEnableSpringELCompiler(true); engine.setTemplateResolver(templateResolver()); return engine; } However eclipse is telling me: The type org.thymeleaf.dialect.IExpressionEnhancingDialect cannot be resolved. It is indirectly referenced from required .class files What does this mean and how can I fix it? In pom.xml I have: <dependency> <groupId