Download the PHP package lascyb/think-template without Composer

On this page you can find all versions of the php package lascyb/think-template. 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-template

Lascyb 模板引擎

主要特性

安装(一般需配合 lascyb/think-view 使用)

composer require lascyb/think-template;

相关用法基本与 ThinkTemplate 相同,但是在视图文件夹中增加了配置文件,和主题模板目录,目录结构如下

  • comtroller
  • model
  • view
  • default
  • index
  • index.html
  • index.json
  • public
  • header.html
  • header.json
  • footer.html
  • footer.json
  • red
  • index
  • index.html
  • index.json
  • 以上定义了一个default 主题 和 red 主题,并分别为模板文件定义了配置文件
  • 需要注意的是,如果index.html 引用了 header.html 或者使用了模板布局, 如果各个模板文件的名称不相同则无妨,但若是存在文件名相同的模板,则会存在优先级问题( 当前模板文件 > include标签包含的模板文件 > extend标签包含的模板文件 布局标签包含的模板文件 > 模板布局文件 > 视图文件配置的tpl_replace_string)
  • 若启用主题模板,需要在试图配置(一般是view.php)中添加theme 配置 如

ThinkTemplate

基于XML和标签库的编译型模板引擎

主要特性

安装

composer require topthink/think-template

用法示例

<?php
namespace think;

require __DIR__.'/vendor/autoload.php';

// 设置模板引擎参数
$config = [
    'view_path' =>  './template/',
    'cache_path'    =>  './runtime/',
    'view_suffix'   =>  'html',
];

$template = new Template($config);
// 模板变量赋值
$template->assign(['name' => 'think']);
// 读取模板文件渲染输出
$template->fetch('index');
// 完整模板文件渲染
$template->fetch('./template/test.php');
// 渲染内容输出
$template->display($content);

支持静态调用

use think\facade\Template;

Template::config([
    'view_path' =>  './template/',
    'cache_path'    =>  './runtime/',
    'view_suffix'   =>  'html',
]);
Template::assign(['name' => 'think']);
Template::fetch('index',['name' => 'think']);
Template::display($content,['name' => 'think']);

详细用法参考开发手册


All versions of think-template with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.0
psr/simple-cache Version ^1.0
ext-json Version *
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 lascyb/think-template contains the following files

Loading the files please wait ....