Download the PHP package rain-sjh/think-twig without Composer

On this page you can find all versions of the php package rain-sjh/think-twig. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package think-twig

think-twig

tp6 twig模板

安装方式

缓存配置

安装完成后请在config配置文件view.php进行一下配置

return [
    // 模板引擎类型使用 Think
    'type'          => 'Twig',
    // 默认模板渲染规则 1 解析为小写+下划线 2 全部转换小写 3 保持操作方法
    'auto_rule'     => 1,
    // 模板目录名
    'view_dir_name' => 'view',
    // 模板后缀
    'view_suffix'   => 'twig',
    // 模板文件名分隔符
    'view_depr'     => DIRECTORY_SEPARATOR,
    // 模板引擎普通标签开始标记
    'tpl_begin'     => '{{',
    // 模板引擎普通标签结束标记
    'tpl_end'       => '}}',
    // 标签库标签开始标记
    'taglib_begin'  => '{%',
    // 标签库标签结束标记
    'taglib_end'    => '%}',
    // 是否开启缓存
    'tpl_cache'    => true
];

如需拓展twig模板函数,请在extend下创建 TwigExpand.php 并实现接口

use Twig\Extension\AbstractExtension;
use Twig\NodeVisitor\NodeVisitorInterface;
use Twig\TokenParser\TokenParserInterface;
use Twig\TwigFunction;
use Twig\TwigFilter;

class TwigExpand extends AbstractExtension
 {
    /**
     * 过滤器 拓展.
     * @return TwigFilter[]
     */
    public function getFilters()
    {
        return [
        ];
    }

    /**
     * 函数 拓展.
     * @return TwigFunction[]
     */
    public function getFunctions()
    {
        return [
        ];
    }

    /**
     * Token的解析器 拓展.
     * @return array|TokenParserInterface[]
     */
    public function getTokenParsers()
    {
        return [];
    }

    /**
     * 节点访问器 拓展.
     * @return array|NodeVisitorInterface[]
     */
    public function getNodeVisitors()
    {
        return [];
    }

    /**
     * 测试 拓展.
     *
     * @return Twig_Test[]
     */
    public function getTests()
    {
        return [];
    }

    /**
     * 运算符 拓展.
     * @return array<array> First array of unary operators, second array of binary operators
     */
    public function getOperators()
    {
        return [];
    }
 }

All versions of think-twig with dependencies

PHP Build Version
Package Version
Requires php Version >=5.1.0
twig/twig Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rain-sjh/think-twig contains the following files

Loading the files please wait ....