PHP code example of artox-lab / sms-bundle
1. Go to this page and download the library: Download artox-lab/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/ */
artox-lab / sms-bundle example snippets
// config/bundles.php
return [
// ...
ArtoxLab\Bundle\SmsBundle\ArtoxLabSmsBundle::class => ['all' => true],
];
// src/Controller/FooController.php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use ArtoxLab\Bundle\SmsBundle\Service\ProviderManager;
use ArtoxLab\Bundle\SmsBundle\Sms\Sms;
class FooController extends Controller
{
public function barAction(ProviderManager $providerManager)
{
$sms = new Sms('+12345678900', 'The cake is a lie');
$provider = $providerManager->getProvider('your_provider_name');
$provider->send($sms);
}
}