PHP code example of ilkatkov / vkmarlib_php

1. Go to this page and download the library: Download ilkatkov/vkmarlib_php 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/ */

    

ilkatkov / vkmarlib_php example snippets


$content = file_get_contents('php://input');
$m = new VKMarLib\Skill($content);

$m->setText("Hello, world!");
$m->setEndSession(); // устанавливаем конец сессии
echo $m->getResponseJson(); // вывод ответа вебхука

use VKMarLib\Classes\Card;

$cardType = "BigImage";
$card = new Card($cardType);

composer 
$content
'php://input'
existInTokens(...$values)
addButtons(array $titles)
addCard(Card $card)
setSessionState(string $key, $value)
setUserState(string $key, $value)