alemachado/template-twig
Composer 安装命令:
composer require alemachado/template-twig
包简介
Adds a Twig render method to Page
关键字:
README 文档
README
Adds a Twig render method to Page
For more information on Twig visit http://twig.sensiolabs.org/
Copyright (C) 2012 by Paul Sheean porl42@gmail.com
Licensed under GNU/GPL v2, see LICENSE.txt
For Twig license see LICENSE.twig.txt
Installation
-
Copy
TemplateTwigdirectory tosite/modules -
Enable
TemplateTwigmodule in ProcessWire -
Ensure module configuration (paths etc) is correct.
-
Your templates now have access to a twig parameter that can be used as follows:
$variables = array("foo" => "bar", "hello" => "world); echo $page->twig->render('basic-page.html.twig', $variables);The
templatesdirectory with this module contains sample Twig templates and views
that recreate the standard site-default templates with Twig. If you don't want to use
them then just create thetemplates/viewsdirectory and use the files from here
as a guide to make your own. -
Create pages that use the twig templates.
NOTE: As Twig handles html escaping etc itself, you can usually remove any htmlspecialchars filters from your fields. If you don't do this you may run into double-escaping issues.
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0
- 更新时间: 2015-03-26