Download the PHP package tuum/view without Composer

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

View Template

Scrutinizer Code Quality

A raw PHP based template with sections, block, and layout, but no escaping functions.

To escape values displayed in a template, use other packages, such as Tuum/Form.

Licence

MIT Licence

PSR

PSR-1, PSR-2, and PSR-4.

Getting Started

Installation

Sample Code

Constructing the renderer:

To render a PHP template file,

The template file at /path/to/view/my/file-name.php may be:

The Tuum/View does not escape the value. Please use helpers to escape before displaying the values.

Using Layout

You can set a default layout in the renderer:

or set layout inside individual template file (hence overwrites the default layout):

layout file

In a layout file, emit content (from the initial template file) using method.

Using Section

in template file

In a template file, define a section using
and ,

in layout file

In a layout file, use the defined section as:

You can check if a section is defined:

replaceBy method

Using in layout file may make it clearer...

method will take the output from a section (from till method) and checks if the named section exists or not. If the section exists, it outputs the existing section, or outputs the section in the layout.

disabling a section in layout

In the template file, it is possible to set a section not to be displayed at all by using method.

In template file:

In layout file:

Because the section is marked as NotToRender, the entire bread section will not be rendered.

This also works for as well. So, for the example for will not be displayed at all if marked as NoDisplay.

Using Block

To include another template, use method in a template file as:

The is another template file. The template's data is shared with the block template.

blockAsSection method

Some times, one might want to use a block as a section (well, I do). So, here's an easy way to do.


All versions of view 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 tuum/view contains the following files

Loading the files please wait ....