Download the PHP package mindplay/kisstpl without Composer

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

mindplay/kisstpl

PHP Version Build Status Code Coverage Scrutinizer Code Quality

A very simple view-service / template-engine for plain PHP templates.

I wanted a template engine that uses view-models (objects) rather than view-dictionaries (arrays) as are typical in most PHP template engines.

Oh, and if you don't like typing htmlspecialchars() all day, maybe try this.

The view-service is tied to a root folder and a root namespace:

The render() statement in this example will render the template my/app/views/HelloWorld.view.php, passing the view-model object to the rendered template as $view - the SimpleViewFinder is responsible for locating the actual template based on the type of view-model.

The render() method also accepts a second argument, allowing you to render different templates for the same view-model:

You can type-hint in the beginning of a template file for IDE support:

Alternatively, for type-safe template rendering, you can also type-hint statically, by returning a closure:

Things like layouts can be accomplished by using plain OOP composition. For example, let's say we have a Layout view-model with a $body property, and we have an instance of the layout view-model in a $layout property of the HelloWorld model - to implement a typical two-step layout, in the HelloWorld template, use begin() and end() to buffer and capture a section of content:

Note that begin() and end() take variable references as arguments - the call to end() will apply the captured content to $view->layout->body.

There is deliberately no view rendering "pipeline", or any concept of layout, and this is "a good thing" - your templates have complete control of the rendering process, you have IDE support all the way,

You can also capture rendered content and return it, instead of sending the rendered content to output:

You can use this feature to implement "partials", since it can be called from within a template. Like render(), the capture() method also accepts a second argument allowing you to render different views of the same view-model.

You can of course also extend ViewService with custom functionality - an interface Renderer defines the four basic methods, render(), capture(), begin() and end() so you can type-hint and swap out implementations as needed.

You can also replace the ViewFinder implementation if you need custom logic (specific to your project) for locating templates. A few implementations are included:

The latter is useful in modular scenarios, e.g. using a "theme" folder for template overrides, allowing you to plug in as many conventions for locating views as necessary.


All versions of kisstpl with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3
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 mindplay/kisstpl contains the following files

Loading the files please wait ....