phplang/xhp-lib

XHP XHTML PHP library for xhp

0.0.1 2016-08-13 21:10 UTC

This package is not auto-updated.

Last update: 2024-10-26 22:22:10 UTC


README

Forked from https://github.com/facebook/xhp-lib/tree/1205aad1045912c4ccb747b297f0093a4196c202 by Facebook Inc.

This is a community maintained fork of xhp-lib/php-lib focused on non-hack syntax. It is meant to be used with https://github.com/phplang/xhp on PHP. Users of HHVM should install the official xhp-lib at https://github.com/facebook/xhp-lib which has full hack type checker support.

Autoloading

xhp-lib ships with an ClassLoader implementation which can be used by projects in a composer autoload "files" include as follows:

In composer.json:

{
  "autoload": {
    "files": [
      "src/xhp-autoload.php"
    ]
  }
}

And in src/xhp-autoload.php:

<?php

(new PhpLang\XhpLib\ClassLoader([
  ':view' => __DIR__ . '/../view/',
])->register();

In the above example, tags like <view:card:foo/> will be autoloaded from view/card/foo.php in the package root.