手机版
贴心博客(Imblog)(LOGO)

贴心博客(Imblog)

v5.7

基于`jquery2+bootstrap4+贴心猫`开发

谁抄谁?英雄所见略同!

发布:2022-01-06 19:43   点击:1次   评论:0
### 谁抄谁?英雄所见略同! * js-ES6, python, PHP 连接字符串比较 * Jinja, Twig(PHP), Twig.js 模板引擎比较 -------------------------- ### js-ES6, python, PHP 连接字符串比较 ```js // js-ES6 var name1 = "Peace"; var age1 = 88; res = `Hello,${name1}, your age is ${age1}`; ``` ```python #python name1 = "Peace"; age1 = 88 res = f"Hello,{name1}, your age is {age1}" ``` ```PHP # PHP $name1 = "Peace"; $age1 = 88; $res = "Hello,{$name1}, your age is {$age1}"; ``` -------------------------- ### Jinja, Twig(PHP), Twig.js 模板引擎比较 * Twig(PHP) : The flexible, fast, and secure template engine for PHP. * Jinja2 : is one of the most used template engines for Python. * Twig.js : is a pure JavaScript implementation of the Twig PHP templating language. 参考: * https://twig.symfony.com/ * https://palletsprojects.com/p/jinja/ * https://github.com/twigjs/twig.js/wiki ``` {% extends "layout.html" %} {% block body %} {% endblock %} ``` ```

My Webpage

{{ a_variable }} ``` ``` {% twig_js name="greeting" %} Hello {{ name|default("World") }}! ```
评论(0条) 评论列表
 

公司简介 企业文化 服务内容 公司新闻 公司图片 常见问题 联系我们 责权申明

贴心博客(Imblog)基于`jquery2+bootstrap4+贴心猫`开发; QQ群:607070548; 粤ICP备07020797号

Run:1.135/19.971(ms); 3(sql)/2.176(MB); v4:info/detail; Upd:2024-04-30 05:10:36