PHPackages                             finalclass/nbml - 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. finalclass/nbml

ActiveLibrary

finalclass/nbml
===============

1.1.0(13y ago)150PHPPHP &gt;=5.3.0

Since Jul 5Pushed 13y agoCompare

[ Source](https://github.com/finalclass/nbml)[ Packagist](https://packagist.org/packages/finalclass/nbml)[ RSS](/packages/finalclass-nbml/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (4)Used By (0)

NetBricks Markup Language \[welcome\]
=====================================

[](#netbricks-markup-language-welcome)

Nbml is a language which serves to define views in object-oriented manner. With its help we can easily transform view in phtml format (HTML with insertions in PHP language), to PHP classes.

System requirements \[system-requirements\]
===========================================

[](#system-requirements-system-requirements)

The nbml library requires PHP in version minimum 5.3

Instantiation \[instantiation\]
===============================

[](#instantiation-instantiation)

In order to start working with nbml files, one has to initialise ViewAutoLoader. This class registers php autoloader, so it can handle \*.nbml file. It can be done using provided sandbox, or manually. It is also needed to initialise some autoloader to nbml library classes - because nbml uses standard method to load classes this action is left to the programmer. But at first lets' go to the easier variant - to start work using sandbox file \[instantiation-sandbox\].

Instantiation using sandbox \[instantiation-sandbox\]
-----------------------------------------------------

[](#instantiation-using-sandbox-instantiation-sandbox)

It is the simplest, and at the same time the least flexible method to initialise nbml.

```
$viewAutoLoader = include 'library/Nbml/sandbox_runtime.php';

```

Creating an instance manually \[instatiation-manual\]
-----------------------------------------------------

[](#creating-an-instance-manually-instatiation-manual)

We can, of course, initialise the interpreter manually. Thanks to this we can at its fullest have benefit from the configuration options, which are provided by the interpreter. Below you can find an exemplary manual configuration:

**file index.php**

```

 Example component

```

Let's put it in MyNamespace\\Example folder and name it Example.nbml (the file would be in this location: /MyNamespace/Example/Example.nbml)

Now let's execute somewhere in \*.php file following instruction:

```

     Example component
