Download the PHP package bayfrontmedia/veil without Composer

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

Veil

A fast, lightweight, framework-agnostic PHP template engine.

Although there are some respectable, well-known PHP template engines available, most of them can be extremely complex and include a great deal of customized syntax to learn. In addition, using proprietary libraries to perform simple functions and iterations can introduce unnecessary complexity and overhead, especially since PHP is a templating language in and of itself.

While it may not be suitable for every outlying case, Veil has been created to provide minimal and rapid template language functionality, including template inheritance, in a simple framework-agnostic library.

License

This project is open source and available under the MIT License.

Author

Bayfront Media

Requirements

Installation

Usage

Start using Veil

Default configuration:

Working with content

Template tags

A variety of template tags can be used with Veil. This allows for functionality such as template inheritance (chaining files), injection of content, and usage of passed parameters.

The following template tags can be used in HTML and view files:

Tag Function
@use:path/from/base Adds contents of another file
@markdown:path/from/base Adds markdown of another file as HTML (see markdown)
@inject:type Injects content (see inject)
@section:name Defines a section to be placed in a view (see sections)
@place:name Places a defined section into the view (see sections)
?@place:name Places an optionally defined section into the view (see sections)
{{-- Comment —-}} Everything inside comment tags will be ignored and removed
{{parameter.name}} Replaced with escaped value from the $data array in dot notation
{{!parameter.name}} Replaced with unescaped (raw) value from the $data array in dot notation
{{parameter.name||default}} Replaced with escaped value from the $data array in dot notation or default value if not existing *
{{!parameter.name||default}} Replaced with unescaped (raw) value from the $data array in dot notation or default value if not existing *
Note:

The default value can be either a plaintext string, or another key on the $data array in dot notation.

Sections

Sections are used to define a block of HTML using the @section tag, which is placed in a view using the @place tag.

Example pages/index:

Example layouts/default:

In the examples above, the sections head and content are defined in pages/index, then placed in layouts/default.

In addition, an optional end_body section is placed before the closing body tag.

Raw PHP

View files can directly access the $data array in raw PHP. In fact, any other PHP code can be directly embedded in any view file. However, this should be kept to simple tasks such as performing loop iterations. Frequently embedding raw PHP from your view may be a sign you have too much logic within the template.

Public methods


getBasePath

Description:

Returns base path.

Parameters:

Returns:


setBasePath

Description:

Sets base path.

Parameters:

Returns:


inject

Description:

Add injectable(s) by their respective types.

Default injectable types to use in your templates include:

In addition to the default injectable types, custom types can be added and used.

NOTE: If $content is an array, all injectables will share the same priority.

Parameters:

Returns:

Example:

Using the above example, whenever the @inject:js template tag appears, it will be replaced with:


getHtml

Description:

Get compiled HTML as a string.

Parameters:

Returns:

Throws:

Example:


html

Description:

Echo compiled HTML.

Parameters:

Returns:

Throws:

Example:


getView

Description:

Get compiled template file as a string.

Parameters:

Returns:

Throws:

Example:


view

Description:

Echo compiled template file.

Parameters:

Returns:

Throws:

Example:


minify

Description:

Minify HTML.

Currently, Veil uses Tiny Html Minifier for this method.

NOTE: In some cases, HTML may not minify correctly, so use with caution. It is recommended you test this with your HTML and views before using in production.

Parameters:

Returns:

Example:

See markdown.


markdown

Description:

Convert Markdown syntax to HTML.

Currently, Veil uses Parsedown for this method.

Parameters:

Returns:

Example:

Convert a view file containing markdown to minified HTML:


All versions of veil with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
bayfrontmedia/php-array-helpers Version ^2.0
bayfrontmedia/php-sanitize Version ^2.1
erusev/parsedown Version ^1.7.4
pfaciana/tiny-html-minifier Version *
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 bayfrontmedia/veil contains the following files

Loading the files please wait ....