Download the PHP package velliz/pte without Composer

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

PTE - Puko Templating Engine

PTE is a standalone templating engine built for performance and compatibility for standalone use. When PTE is in action, it traverses an HTML DOM tree into a PHP array (lexer) and combines the output with data specifications (parser). On average, it takes 0.004 seconds to render the HTML page with caching turned off, and 0.002 seconds with caching turned on, based on the provided example in index.php.

Installation

composer require velliz/pte

The command is used to install the "velliz/pte" package using Composer. It adds the package as a dependency to your project.

Another requirement:

Tags Available

Tags Description
{!x} Value or Part Objects tags
<!--{!x}--> open loop tags
<!--{/x}--> close loop tags
{!fn()} function tags with no parameters
{!fn(x)} function tags with one parameters
{!fn(x,y,z)} function tags with multiple parameters
{CONTENT} CONTENT tags only works on master file
{!css(<link href="" rel="stylesheet" type="text/css" />)} CSS tags
{!js(<script src="" type="text/javascript"></script>)} JavaScript tags
{!part(css)} move CSS tags location to this tag
{!part(js)} move JavaScript tags location to this tag
{x.html} segment file tags

Usage sample

Instance the object:

In the code snippet above, an object of the Pte class is instantiated with three parameters: true for caching the template file, true for using the master file, and true for using the HTML body file.

The master file is set using the SetMaster() method with the file path 'template/master.html', and the HTML file for the view template is set using the SetHtml() method with the file path 'template/view.html'.

You also can create your own parsing rules with custom class like this:

The above code defines the BaseUrl class, which implements the \pte\CustomRender interface. The Parse() method is used to define custom parsing rules for the templating engine. In this example, if the function name is 'url', it returns a URL constructed using the provided parameter. Otherwise, it returns an empty string.

To render tags in the HTML DOM using the BaseUrl custom class, you can use the following code:

In order to set the data value, you can create an instance of the BaseUrl class and pass it as the first parameter to the SetValue() method. The second parameter should be the data in an array format. Here's an example:

To obtain the result, you can use the Output() method, which processes the HTML input using the lexer and parser. Here's an example:

You also have the option to choose Pte::VIEW_JSON as the output format.


Examples

master.html

view.html

About

Crafted with <3 from Bandung, Indonesia.

Copyright 2017 by Didit Velliz


All versions of pte with dependencies

PHP Build Version
Package Version
No informations.
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 velliz/pte contains the following files

Loading the files please wait ....