Download the PHP package baagee/php-template without Composer

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

Template php轻量的模板解析引擎

php Template View

内置主要方法

基本使用

输出一个变量

输出标签是由一对花括号做为定界符的,不支持输出数组

if分支判断

if elseif

循环语句

循环一个数组用 loop 标签,与php中的 foreach 函数类似,第一个参数为数组的索引,第二个参数为数组第一项的值 只要标签成对匹配,模板中的标签是可以嵌套使用的。

一行php语句

由于某些时候需要使用一些php来输出内容,比如格式化时间戳为日期时,此写法并不支持多行php语句

引用一个模板文件

在模板中如果需要引用其它模板文件可以使用以下的方法,路径从View下级开始写,被引入的模板里也可以引入其他模板,多层次嵌套

layout布局

可以多层次嵌套布局,比如article控制器的模板,使用叫做main1的布局,而main1又使用了main2的布局...

父模板挖坑 baseLayout.tpl

子模板继承父模板填坑。mainLayout.tpl

孙模板 具体的action对应的模板

注意

  1. 并不是每个父模板挖的坑子模板都必须填,可以根据需求填。
  2. 子模板不能跨级填坑,只能填它父亲的坑,不能填爷爷的坑。
  3. 坑和坑之间的字符不会输出,模板编译时会直接丢弃填坑标签之外的字符。

具体示例代码:tests目录


All versions of php-template with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
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 baagee/php-template contains the following files

Loading the files please wait ....