PHP Class Arcanedev\SeoHelper\Entities\Twitter\Card

Author: ARCANEDEV ([email protected])
Inheritance: implements Arcanedev\SeoHelper\Contracts\Entities\TwitterCardInterface, use trait Arcanedev\Support\Traits\Configurable
Show file Open project: arcanedev/seo-helper

Protected Properties

Property Type Description
$images array Card images.
$metas Arcanedev\SeoHelper\Contracts\Entities\MetaCollection Card meta collection.
$type string Card type.

Public Methods

Method Description
__construct ( array $configs = [] ) Make the twitter card instance.
__toString ( ) : string Render the tag.
addImage ( string $url ) : Card Add image to the card.
addMeta ( string $name, string $content ) : Card Add a meta to the card.
addMetas ( array $metas ) : Card Add many metas to the card.
render ( ) : string Render the twitter card.
reset ( ) : Card Reset the card.
setDescription ( string $description ) : Card Set card description.
setSite ( string $site ) : Card Set card site.
setTitle ( string $title ) : Card Set card title.
setType ( string $type ) : Card Set the card type.
types ( ) : array Get all supported card types.

Private Methods

Method Description
checkSite ( string &$site ) Check the card site.
checkType ( string &$type ) Check the card type.
init ( ) : Card Start the engine.
loadImages ( ) Render card images.
prepareUsername ( string $username ) : string Prepare username.
setPrefix ( string $prefix ) : Card Set meta prefix name.

Method Details

__construct() public method

Make the twitter card instance.
public __construct ( array $configs = [] )
$configs array

__toString() public method

Render the tag.
public __toString ( ) : string
return string

addImage() public method

Add image to the card.
public addImage ( string $url ) : Card
$url string
return Card

addMeta() public method

Add a meta to the card.
public addMeta ( string $name, string $content ) : Card
$name string
$content string
return Card

addMetas() public method

Add many metas to the card.
public addMetas ( array $metas ) : Card
$metas array
return Card

render() public method

Render the twitter card.
public render ( ) : string
return string

reset() public method

Reset the card.
public reset ( ) : Card
return Card

setDescription() public method

Set card description.
public setDescription ( string $description ) : Card
$description string
return Card

setSite() public method

Set card site.
public setSite ( string $site ) : Card
$site string
return Card

setTitle() public method

Set card title.
public setTitle ( string $title ) : Card
$title string
return Card

setType() public method

Set the card type.
public setType ( string $type ) : Card
$type string
return Card

types() public method

Get all supported card types.
public types ( ) : array
return array

Property Details

$images protected property

Card images.
protected array $images
return array

$metas protected property

Card meta collection.
protected MetaCollection,Arcanedev\SeoHelper\Contracts\Entities $metas
return Arcanedev\SeoHelper\Contracts\Entities\MetaCollection

$type protected property

Card type.
protected string $type
return string