PHP code example of extendy / jormall-sms-bundle
1. Go to this page and download the library: Download extendy/jormall-sms-bundle 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/ */
extendy / jormall-sms-bundle example snippets
namespace App\Controller;
use Extendy\JormallSmsBundle\Service\JormallSmsService;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
class TestController extends AbstractController
{
private $jormallSmsService;
public function __construct(JormallSmsService $jormallSmsService)
{
$this->jormallSmsService = $jormallSmsService;
}
#[Route('/test', name: 'app_test')]
public function index()
{
$msg = "Hello, this is a test message";
// send sms
dd($this->jormallSmsService->sendSms("962777774221", $msg, "1"));
}
#[Route('/test/balance', name: 'app_test_balance')]
public function balance()
{
// get sms balance
dd($this->jormallSmsService->getBalance());
}
}