Download the PHP package popphp/pop-view without Composer

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

pop-view

Build Status Coverage Status

Join the chat at https://popphp.slack.com Join the chat at https://discord.gg/TZjgT74U7E

Overview

pop-view is the view template component that can be used as the "V" in an MVC stack or independently as well. It supports using both PHP-file based templates and stream templates. Within the stream templates, there is basic support for logic and iteration for dynamic control over the view template.

pop-view is a component of the Pop PHP Framework.

Top

Install

Install pop-view using Composer.

composer require popphp/pop-view

Or, require it in your composer.json file

"require": {
    "popphp/pop-view" : "^4.0.0"
}

Top

Quickstart

Consider a phtml template file like this:

You can set up a view object and populate data like this:

which will produce:

Top

File Template

A file template simply uses PHP variables to deliver the data and content to template to be rendered. With a file template, you have full access to the PHP environment to write any additional code or helper scripts. However, in using this, you must make sure to adhere to the best practices and standards regarding the security of the application.

hello.phtml

You can set up the view object like this:

Top

Stream Template

A stream template uses a formatted string placeholder to deliver the data and content to template to be rendered:

hello.html

You can set up the view object in a similar way and it will render the exact same as the file template example.

Top

Includes

Stream templates support includes to allow you to include other templates within them.

header.html
footer.html
index.html

You can set up the view object like before:

Top

Inheritance

Stream templates support inheritance to allow you to extend other templates.

parent.html
child.html

You can set up the view object like before:

Top

Iteration

Iteration is possible in stream templates when working with arrays and array-like objects.

Top

Conditionals

Conditional logic is possible within a stream template as well.

Top


All versions of pop-view with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1.0
popphp/pop-filter Version ^4.0.0
popphp/pop-utils Version ^2.1.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 popphp/pop-view contains the following files

Loading the files please wait ....