PHPackages                             zeptech/opal - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. zeptech/opal

ActiveLibrary[Templating &amp; Views](/categories/templating)

zeptech/opal
============

Companion object generation

1.0.2(13y ago)1149BSDPHPPHP &gt;=5.3.0

Since May 2Pushed 11y ago1 watchersCompare

[ Source](https://github.com/pgraham/opal)[ Packagist](https://packagist.org/packages/zeptech/opal)[ Docs](https://github.com/pgraham/opal)[ RSS](/packages/zeptech-opal/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

O-pal: Companion class generator for PHP
========================================

[](#o-pal-companion-class-generator-for-php)

Generate and instantiate PHP companion objects. Companion objects are genated based on two inputs, a class definition and a companion object template. Template documentation can be found on [the php-code-templates github site](https://github.com/pgraham/php-code-templates)

Example
-------

[](#example)

Given a companion template (Validator.tmpl.php):

```
