PHPackages                             azandazama/menuplus - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. azandazama/menuplus

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

azandazama/menuplus
===================

MenuPlus: A PHP library that simplifies the process of creating ussd applications

v1.0(5y ago)016MITPHP

Since May 21Pushed 4y ago1 watchersCompare

[ Source](https://github.com/azandazama/MenuPlus)[ Packagist](https://packagist.org/packages/azandazama/menuplus)[ RSS](/packages/azandazama-menuplus/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

MenuPlus
========

[](#menuplus)

[Ussd](https://en.wikipedia.org/wiki/Unstructured_Supplementary_Service_Data) is an amazing technology for anyone looking to create apps which can reach a large volume of people. Ussd is an ancient technology yet it still serves a purpose in our day and age. This PHP library simplies the process behind creating said apps with the [AAT Mobile Ussd API](https://www.aat.co.za/always-active-mobile/ussd/)

Read more about MenuPlus:

- [Requirements](#requirements)
- [Installation](#installation)
- [Ussd Menus](#ussd-menus)
- [Getting Started](#getting-started)
- [Author](#author)
- [License](#license)

Requirements
------------

[](#requirements)

In order for you to use MenuPlus you need to set up an account with [AAT Mobile](https://www.aat.co.za/always-active-mobile/ussd/) for ussd, after which you can require this library and code away 👨🏽‍💻

Installation
------------

[](#installation)

MenuPlus is installed via [Composer](https://getcomposer.org/).

```
composer require azandazama/menuplus
```

You can of course also manually edit your composer.json file

```
{
    "require": {
        "azandazama/menuplus": "^1.0"
    }
}
```

Ussd Menus
----------

[](#ussd-menus)

*MenuPlus* offers different types of ussd menus which serve different purposes. Code and screenshots will be shown below.

### Standard Menu

[](#standard-menu)

This menu has all the bells and whistles offering you with unlimited options and option urls. [screenshot](https://ztdev.co.za)

```
$ussd->title = 'Welcome to the Example Ussd Platform!';
$ussd->options = ['Option 1', 'Option 2', 'Option 3'];
$ussd->option_url = ['index.php?page=1', 'index.php?page=2', 'index.php?page=3'];
echo $ussd->addMenu($url);
```

Options have URLs( `$ussd->option_url` ) and you can consider Options( `$ussd->options` ) as links and menus as pages. Options and Option URLs are parallel arrays and each option corrisponds to each option URL

### Free Text Menu

[](#free-text-menu)

This menu has no options and the title is therefore considered as the option. [screenshot](https://ztdev.co.za)

```
$ussd->title = 'Please provide first and last name';
$ussd->option_url = 'index.php?file=4';
echo $ussd->addMenu($url);
```

### Paginated Menu

[](#paginated-menu)

This menu offers all the bells and whistles and also allows you to order your menu with pagination

```
$ussd->title = 'Select an option';
$ussd->options = ['Option 1', 'Option 2', 'Option 3', 'Option 4', 'Option 5', 'Option 6', 'Option 7'];
// Menu options can all share the same url
$ussd->option_url = 'index.php?page=5';
// [3] is the amount of options that will be shown in this menu
return $ussd->paginateMenu($url, 3);
```

Getting Started
---------------

[](#getting-started)

The following is a basic usage example of the MenuPlus library.

```
