Download the PHP package zareismail/compilex without Composer

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

Introduction

Displaying Data

Directives

Customization

Welcome to the documentation for Compilex - a powerful PHP view compilation package designed to streamline the process of rendering dynamic templates. With Compilex, PHP developers can effortlessly compile templates, replace variables, and handle logical statements, all within a string context. This package aims to provide a flexible and efficient solution for generating dynamic content, allowing developers to focus on crafting exceptional user experiences.

In this documentation, you will find comprehensive information, examples, and guidelines to help you understand and harness the capabilities of Compilex. Whether you are new to view compilation or seeking to enhance your existing workflows, this documentation will serve as a valuable resource to navigate through the features and unleash the full potential of Compilex.

Let's get started and embark on a journey to simplify view compilation in PHP!

Getting Started

You can install the compilex via Composer by running the following command:

After installation, you can use the compiler as follows:

Display Variables

You may display data that is passed to your Compilex patterns by wrapping the variable in curly braces. You can display the contents of the name variable like so:

For exmaple:

Multiple Variables

You can also display valid value of multiple variables by using the or operator:

For exmaple:

Default Values

If a variable is missing, you can display a default value using a quoted string:

For exmaple:

Basic Of Directives

By default, Compilex supports essential directives. All of the Compilex directives have the following syntax:

Where the directive can be one of the default directives or any of the custom directives. The statement should satisfy the directive requirements, and the expression can be any renderable string.

Conditional Statements

The conditional statements are useful to render or hide expressions based on a condition. By default, we have two conditional statements: if and unless. You can use the if directive to render an enclosed expression if the condition is true, and the unless directive to render an enclosed expression if the condition is false.

The conditional statements follow the below structure:

In addition, the conditional statements support the following comparison operators:

You can generate other comparisons by changing the directive (if/unless). Here are some examples:

Positive Statements

Sometimes you need to render conditional statements only if a variable has a valid value. For this situation, you can change the structure of the conditional statements as follows:

for exmaple:

Loop

Compilex also supports loop statements with the following structure:

The valueName and indexName in the loop structure hold the value and index of your iterative variable. You can access the loop item and index inside the loop expression using these names. The variableName is the name of the attribute that holds your loop data, and of and in are static keywords of the loop structure. You can also omit passing the index name, in which case you can access the loop index using the index keyword.

Here are some examples:

Nested Statements

One of the great features of Compilex is supporting nested directives. This means you can use any of the statements inside other statements, and you can even use statements inside themselves. Here are some examples:

Custom Directives

If you need additional directives, you can easily define custom directives using the extend method. Here's an example:

You can use your custom directive like this:

That's it! With these directives and examples, you should be able to harness the power of Compilex in your PHP view compilation.

Happy coding!


All versions of compilex with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3|^8.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 zareismail/compilex contains the following files

Loading the files please wait ....