Skip to content

Commit a763bff

Browse files
author
fangliang
committed
translated template-engines
1 parent 42ef517 commit a763bff

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

docs/guide-zh-CN/tutorial-template-engines.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
Using template engines
1+
使用模板引擎
22
======================
33

4-
By default, Yii uses PHP as its template language, but you can configure Yii to support other rendering engines, such as
5-
[Twig](http://twig.sensiolabs.org/) or [Smarty](http://www.smarty.net/) available as extensions.
4+
默认情况下,Yii 使用 PHP 作为其默认的模板引擎语言,但是,你可以配置 Yii 以扩展的方式支持其他的渲染引擎,比如 [Twig](http://twig.sensiolabs.org/)[Smarty](http://www.smarty.net/)等。
65

7-
The `view` component is responsible for rendering views. You can add a custom template engine by reconfiguring this
8-
component's behavior:
6+
组件 `view` 就是用于渲染视图的。你可以重新配置这个组件的行为以增加一个自定义的模板引擎。
97

108
```php
119
[
@@ -34,16 +32,16 @@ component's behavior:
3432
]
3533
```
3634

37-
In the code above, both Smarty and Twig are configured to be useable by the view files. But in order to get these extensions into your project, you need to also modify
38-
your `composer.json` file to include them, too:
35+
在上述的代码中, Smarty 和 Twig 都被配置以让视图文件使用。但是,为了让扩展安装到项目中,你同样需要修改你的 `composer.json` 文件,如下:
3936

4037
```
4138
"yiisoft/yii2-smarty": "*",
4239
"yiisoft/yii2-twig": "*",
4340
```
44-
That code would be added to the `require` section of `composer.json`. After making that change and saving the file, you can install the extensions by running `composer update --prefer-dist` in the command-line.
4541

46-
For details about using concrete template engine please refer to its documentation:
42+
上述代码需要增加到 `composer.json``require` 节中。在做了上述修改,并保存后,你可以运行 `composer update --prefer-dist` 命令来安装扩展。
43+
44+
对于特定模板引擎的使用详细,请参考其文档:
4745

4846
- [Twig guide](https://github.com/yiisoft/yii2-twig/tree/master/docs/guide)
49-
- [Smarty guide](https://github.com/yiisoft/yii2-smarty/tree/master/docs/guide)
47+
- [Smarty guide](https://github.com/yiisoft/yii2-smarty/tree/master/docs/guide)

0 commit comments

Comments
 (0)