# Getting started

# Requirements

In order to install, use and update this package you will need:

Note: You are still able to use PHP 7.2, but is highly discouraged due its end of life.

Alternative install

If you don't like/want to use Composer package manager, see Alternative installation methods (opens new window).

# Installing

WARNING

The following instructions will assume you have composer globally installed (opens new window).

# Getting the composer package

First, require and install the package in your project:

# In your project root directory:
composer require nelson6e65/php_nml

Or update in your composer.json directly:

{
  "require": {
    "php": ">=7.3",
    "nelson6e65/php_nml": "^1.0"
  },
  "minimum-stability": "dev",
  "prefer-stable": true
}

You need to set 'minimum-stability' to 'dev' in order to use 1.0@dev until 1.0.0 release

composer install

TIP

Remember to add your vendor directory in your .gitignore file (Why? (opens new window)).

# Configuring the autoloading

If not already done, configure your app to autoload classes with Composer by including its autoloader (vendor/autoload.php) in your config.php, bootstrap.php or whatever file that performs your initialization. In most of modern PHP frameworks this is made automatically.

Done!

You are able to use NML classes now!

# Using

You only need to import classes under NelsonMartell namespace by using the use operator (opens new window) of PHP:




 







<?php
// Rapid example of Version class usage.

use NelsonMartell\Version;

$nmlVersion = Version::parse(NML_VERSION);
?>

<!-- Implicit to string -->
<p>Nelson Martell Library, version <?= $nmlVersion ?></p>