PHP code example of linusrendahl / social-fontawesome

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

    

linusrendahl / social-fontawesome example snippets


//create the object
$icons = new LinusRendahl\SocialFontAwesome;

//add some icons with the add method
$icons
	->add('http://www.facebook.com')
	->add('http://twitter.com')
	->add('http://instagram.com');

//get the html
$html = $icons->getHtml();

->add('http://facebook.com/user')

//addCustom($url, $class, $title=null)
->addCustom('http://some-other-network.com/user', 'fa fa-some-icon', 'My title!')

->add('http://facebook.com/user')->title('Welcome to my Facebook page!')

->add('http://facebook.com/user')->wrapper('<div class="wrapper">', '</div>')

->add('http://facebook.com/user')->setClass('foobar')

->add('http://facebook.com/user')->setClass('foobar')

->getHtml()

->getArray()

//create the object
$icons = new LinusRendahl\SocialFontAwesome;

//add some icons with the add method
$icons
	->add('http://www.facebook.com')
	->add('http://twitter.com')->title('My Twitter Page!')
	->add('http://instagram.com')->title('Cool pictures!')->setClass('foobar')
	->wrapper('<div class="wrapper">', '</div>');

//get the html
$html = $icons->getHtml();

echo $html;