Download the PHP package pre/phpx without Composer

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

Phpx

Documentation can be found at preprocess.io.

Motivation

I wanted to write a custom compiler, and this syntax appeals to me. It's not a replacement for Javascript, or even a very good implementation. But, I like it. That's all that counts.

If you want to write component-based code, without writing Javascript; then this might work for you.

Getting started

This should work on PHP 7.2 (where it was developed and tested). Make an issue if it's not working on 7.2 or if you'd like to see things added.

What does it render?

The goal was to decouple the compiler from the renderers. Once the Pre\Phpx\Html renderer moves out, you'll need to import it into your project or create a custom render function. The Pre\Phpx\Html render function looks like this:

This means you can define your own namespaced functions and classes, and use them in the Pre\Phpx\Html render function, like:

If you'd prefer to have your components automatically prefixed, define your own render function, You can extend the Pre\Phpx\Html render function:

You can define components as functions or classes:

Since you can define a custom render function, you can decide what your components are allowed to return. HTML-in-PHP syntax is converted to the following form:

You decide what your components return and what your render function does. The Pre\Phpx\Html render function outputs strings of HTML, and expects components rendered by it to return strings (so that they can be concatenated in an array of children).

Returning null will also work.

Roadmap


All versions of phpx with dependencies

PHP Build Version
Package Version
Requires pre/plugin Version ^0.13.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 pre/phpx contains the following files

Loading the files please wait ....