PHP code example of itinerisltd / socialus

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

    

itinerisltd / socialus example snippets



$socialus = new \Itineris\Socialus\Socialus();
echo $socialus->render();

# sage/app/Controllers/App.php

namespace App\Controllers;

use Sober\Controller\Controller;
use Itineris\Socialus\Socialus;

class App extends Controller
{
    public function socialus()
    {
        return new Socialus();
    }
}


$socialus = new Socialus();
$socialus->removeSite('facebook');


$socialus = new Socialus();
$data = [
    'link' => 'https://reddit.com/submit',
    'params' => [ // these are to tell Socialus how to share
        'url' => 'url',
        'title' => 'title',
    ],
    'label' => 'Reddit',
    'icon' => 'fa fa-reddit',
    'image' => '', // optional if icon is set
];
$socialus->addSite('reddit', $data);

$socialus = new Socialus([
    'container_element' => 'div',
    'container_class' => 'socials',
    'item_element' => 'span',
    'item_class' => 'social-item',
    'link_class' => 'social-item-link',
]);

$socialus = new Socialus([
    'type' => 'icon',
    'screen_reader_class' => 'screen-reader',
]);
$socialus_2 = new Socialus([
    'type' => 'image',
]);