Download the PHP package maxonfjvipon/phtml without Composer

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

phtml

phtml is pure object-oriented HTML construction templating library for PHP with functional interface, inspired by JavaTags and ScalaTags.

EO principles respected here DevOps By Rultor.com

Composer codecov Hits-of-Code License Tag

This fragment:

will be turned into this html:

Getting started:

Requirements

Installation

Examples

basic:

Library provides all html tags as functions with only one exception - <var></var>. PHP does not allow you to create function named var since this word is reserved. So to create <var></var> tag use _var function

(if you know more elegant way to handle this <var></var> - please create an issue)

This code

will render to you this html:

Attributes:

To add attributes to your tag you should use attr function. Function accepts an array with arguments. Array may has 'key' => 'value' and just 'value' elements:

Attributes will be rendered only if they are at the first place. Other attributes on other places will be ignored.

Library provides helper class Maxonfjvipon\Phtml\at that contains all existed html attributes as consts. You can use it in this way:

Note!

at::class will return you \Maxonfjvipon\Phtml\at instead of expected 'class' (since ::class is reserved by PHP)

(if it's possible to override this ::class and you know how to do it - please create an issue)

To get 'class' string from at you can do at::_class or at::$class. Or you can just write it manually

Helpers:

Custom tags

You can create your custom tags using 2 helper functions: paired and unpaired:

If you want to add many tags (for example from array) you can use tags function:

Strings, Tags and Texts

Library is based on Maxonfjvipon\ElegantElephant\Txt class from ElegantElephant. So besides attributes every paired tag can accept other tags, strings and Texts.

This tag:

will be turned into:

Import

If you want to use all available tags and functions you have to add this import.

(if you know how to make this whole import shorter - please create an issue)

Keep in mind that some tag functions have the same name as built in php functions (like \header(), \time(), etc). So make sure that you have imported these functions before using them.

Contribution

Fork repository, make changes, send a pull request. To avoid frustration, before sending your pull request please run:

And make sure you have no errors.


All versions of phtml with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
maxonfjvipon/elegant-elephant Version ^4.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 maxonfjvipon/phtml contains the following files

Loading the files please wait ...