Download the PHP package markorstc/laminas-typedview without Composer

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

Typed View Layer for Laminas

Key features

Installation

Install module via Composer

Requirements

PHP 8 or above

Enable module via config

https://user-images.githubusercontent.com/12954262/124970331-145ec180-e028-11eb-82f3-acf8d0ef3e58.mp4

Getting started

Create view model and template

You create a typed view model by extending abstract class TypedView\Entity\ViewModel. Then you specify path to your .phtml template file in TypedView\Entity\ViewModel::getTemplate() method.

https://user-images.githubusercontent.com/12954262/124970100-c9dd4500-e027-11eb-9c17-993ccf338a44.mp4

Use model in controller

To render your model, simply return it in Laminas controller action as you do it with standard Laminas\View\Model\ViewModel.

https://user-images.githubusercontent.com/12954262/124972750-0494ac80-e02b-11eb-9987-914681ba1775.mp4

If you want to use common layout for multiple controllers or actions, you have to implement TypedView\Controller\LayoutModelAware interface in your controller.

At the same time, you specify callback, that will set rendered child model to the parent model (in this case rendered MyListViewModel to parent MyLayoutModel).

https://user-images.githubusercontent.com/12954262/124978106-a0c1b200-e031-11eb-9775-b85f93e0e28e.mp4

Use Laminas view helpers

It's possible to use Laminas standard view helpers, but you have to extend TypedView\Entity\LaminasBridgeModel when creating your typed view model.

If you want to use single particular Laminas view helper and keep clean scope in your template, you can use helper traits e.g. TypedView\Helper\UrlViewHelper.

https://user-images.githubusercontent.com/12954262/125169570-18671c80-e1ab-11eb-88d9-be7676b30ab7.mp4

Nesting view models

It's possible to use view models as individual components and combine them.

To add one model to another use TypedView\Entity\ViewModel::addChild() method and specify capture callback the same way like in the layout model example.

https://user-images.githubusercontent.com/12954262/125174821-37c07280-e1c8-11eb-9cf2-1f49bdecfa45.mp4


All versions of laminas-typedview with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
laminas/laminas-mvc Version ^3.2
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 markorstc/laminas-typedview contains the following files

Loading the files please wait ....