1. Go to this page and download the library: Download denisok94/yii-helper 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/ */
denisok94 / yii-helper example snippets
namespace app\controllers;
use \denisok94\helper\yii2\StatusController;
class MyController extends StatusController
{
// code
}
// получить все данные
$message = $this->post; // array
// получить параметр из данных
$phone = $this->getPost('phone'); // phone or null
// Сообщить об успешной обработки
return $this->sendSuccess(); // http status code 200
// ['code' => '200', 'status' => 'OK', 'data' => []];
// Вернуть результат работы
return $this->sendSuccess($data); // http status code 200
// ['code' => '200', 'status' => 'OK', 'data' => $data];