Download the PHP package easyswoole/template without Composer

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

Template

实现原理

注册N个自定义进程做渲染进程,进程内关闭协程环境,并监听UNIXSOCK,客户端调用携程的client客户端发送数据给进程渲染,进程再返回结果给客户端,用来解决PHP模板引擎协程安全问题。可以实现渲染接口,根据自己的喜好引入smarty或者是blade或者是其他引擎.

引入模板引擎类

下面列举一些常用的模板引擎包方便引入使用:

smarty/smarty

Smarty是一个使用PHP写出来的模板引擎,是目前业界最著名的PHP模板引擎之一

composer require smarty/smarty=~3.1

league/plates

使用原生PHP语法的非编译型模板引擎,更低的学习成本和更高的自由度

composer require league/plates=3.*

duncan3dc/blade

Laravel框架使用的模板引擎

composer require duncan3dc/blade=^4.5

topthink/think-template

ThinkPHP框架使用的模板引擎

composer require topthink/think-template

渲染模板

选择一个心仪的模板引擎,并实现RenderInterface接口,当进程收到一条渲染指令时,会调用该实现类的render方法进行渲染,渲染结束后调用afterRender方法,可在此处进行变量释放清理等操作,以Smarty引擎为例,创建一个渲染器, 并渲染的最小例子如下

用Smarty作为渲染器

启动测试服务器

代码包内置了一个小型的测试服务器,在tests目录下,支持smarty、plates、blade、think四种引擎的快速测试,使用下方代码启动,访问 http://127.0.0.1:9501 即可查看输出,对应的模板文件在test/TemplateViews目录下,可以修改这些模板来测试功能


All versions of template with dependencies

PHP Build Version
Package Version
Requires easyswoole/spl Version ^2.0
easyswoole/component 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 easyswoole/template contains the following files

Loading the files please wait ....