PHP code example of matryoshka-app / sdk-php-core

1. Go to this page and download the library: Download matryoshka-app/sdk-php-core library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

matryoshka-app / sdk-php-core example snippets


$matryoshka = new Matryoshka();
$response = $matryoshka->start();
echo $response;

class MockHandler extends Handler {
    static function getURI() {
        return 'test/1';
    }

    function handler() {
        $menuItem = new MenuItem();
        $menuItem->title = new Text('test');
        
        $response = $this->getResponse();
        $response->menu->add($menuItem);
        $response->addWidget(new Text('testim'));
    }
}

$matryoshka->getHandlerManager()->addHandler(SomeHandler::class);