- 论坛徽章:
- 1
|
本帖最后由 iakuf 于 2013-04-15 10:15 编辑
回复 44# climby
这是基本功能,一定能实现。还有更加多强大的功能。
比如 Dump 数据时,不用象 TT 使用外部的模块。
比如他生成 url 比其它的模板技术也方便- url_for('route_name')->query(foo => 'a', bar => 'b')
复制代码 比如他默认支持的 Mojolicious::Plugin::TagHelpers 这个功能就很强大,原来还不这么认为,上次陈子问我有没有象 Ruby 中一些功能的模板时,我想到,这不就是 TagHelpers 的实现吗。
比如你写个- %= check_box employed => 1
- %= check_box employed => 1, id => 'foo'
- %= image '/images/foo.png', alt => 'Foo'
复制代码 会自动生成 html- <input name="employed" type="checkbox" value="1" />
- <input id="foo" name="employed" type="checkbox" value="1" />
- <img alt="Foo" src="/images/foo.png" />
复制代码 |
|