PHPackages                             constant-null/backstubber - 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. constant-null/backstubber

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

constant-null/backstubber
=========================

Helps to generate full PHP files from tepmlates (stubs)

v1.0.1(9y ago)51.0k11MITPHPPHP &gt;=5.4.0

Since Mar 29Pushed 8y ago1 watchersCompare

[ Source](https://github.com/constant-null/backstubber)[ Packagist](https://packagist.org/packages/constant-null/backstubber)[ RSS](/packages/constant-null-backstubber/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (7)Dependencies (4)Versions (10)Used By (1)

Meet the *Backstubber*, the PHP file generator
==============================================

[](#meet-the-backstubber-the-php-file-generator)

[![GitHub license](https://camo.githubusercontent.com/30c1599a2f94375474e22ae673263aa41b46982d8e51df575ae637a54febf3dc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f636f6e7374616e742d6e756c6c2f6261636b737475626265722e7376673f7374796c653d666c61742d737175617265)](http://badges.mit-license.org/)[![Packagist](https://camo.githubusercontent.com/88ae69904872d4f87ebe3752ad1e4a2febe52138513cf5ac12c4d0d058097a00/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f6e7374616e742d6e756c6c2f6261636b737475626265722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/constant-null/backstubber)[![Travis](https://camo.githubusercontent.com/210499514eb2bc6fdab38e86eeac92756703d0e01990d10d8a72b3aab9a8f55e/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f636f6e7374616e742d6e756c6c2f6261636b737475626265722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/constant-null/backstubber/settings)

Backstubber makes generation of PHP code files from templates fast and easy. Say no to tons of `str_replace`.

installation
------------

[](#installation)

Backstubber can easily be installed using [composer](http://getcomposer.org/). To do so, just run `php composer.phar require-dev constant-null/backstubber`. Or you can add following to your `composer.json` file:

```
{
    "require-dev": {
        "constant-null/backstubber": "~0.1"
    }
}
```

and then run:

```
$ php composer.phar update

```

Usage
-----

[](#usage)

### FileGenerator

[](#filegenerator)

#### Basic substitution

[](#basic-substitution)

Let's say we have a DummyStarship.stub template

```
