PHP code example of mocean / symfony-mocean-bundle

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

    

mocean / symfony-mocean-bundle example snippets


return [
    //... framework bundles
    MoceanSymBundle\MoceanBundle::class => ['all' => true],
];

$bundles = array(
    //... framework bundles
    new MoceanSymBundle\MoceanBundle(),
);

class YourController extends AbstractController
{
    /**
     * @Route("/")
     */
    public function index(MoceanSymBundle\Services\MoceanManager $mocean)
    {
        $res = $mocean->message()->send([
            'mocean-to' => '60123456789',
            'mocean-from' => 'MOCEAN',
            'mocean-text' => 'Hello World'
        ]);
    }
}

class YourController extends Controller
{
    /**
     * @Route("/")
     */
    public function index()
    {
        $mocean = $this->container->get('mocean_manager');
        $res = $mocean->message()->send(...);
    }
}

$mocean->using('secondary')->message()->send(...);
$mocean->using('third')->message()->send(...);