$lib
$lib :
The base class for the Nano framework.
Either make an instance of this directly, or make your own base class that extends this. As per the notice above, you cannot have more than one instance of a Nano-derived object at one time.
__construct( $opts = array())
Construct a new Nano object. By default we build a 'nano' loader which loads Nano extensions from our own folder. You can override the folder of the loader via the 'nanodir' option to the constructor.
This loader is expected to be available by other extensions, so don't mess with it. Oh, and it's a basic constructor, so it only loads libraries, nothing more, nothing less.
| $opts |
addMethod(string $name, mixed $callback)
Add an extension method.
This function allows extensions to add a method to the Nano4 object.
| string | $name | The name of the method we are adding. |
| mixed | $callback | A callback, with exceptions, see below. If the callback parameter is a string, then the normal PHP callback rules are ignored, and the string is assumed to be the name of a library object that provides the given method (the method in the library must be the same name, and must be public.) Class method calls, object method calls and closures are handled as per the standard PHP callback rules. |