PHP code example of avator / symfony-turbosms

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

    

avator / symfony-turbosms example snippets




// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new AVATOR\TurbosmsBundle\AVATORTurbosmsBundle(),
        // ...
    );
}

 

namespace App\YourBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;

class DefaultController extends Controller
{
    /**
     * @Route("/")
     * @Template()
     */
    public function indexAction()
    {
        .....
        $this->get('avator_turbosms.turbosms')->send("test", "+380XXXXXXXXX");
        .....
    }
}
bash
$ php bin/console doctrine:schema:update --dump-sql
bash
$ php app/console doctrine:schema:update --dump-sql